<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: editor   editor.js  (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">

	<div id="hd">
        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
        <h3>editor&nbsp; <span class="subtitle">2.3.1</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_editor.html">editor</a>
                
                 &gt; editor.js (source view) 
            </p>

	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form name="yui-classopts-form">
    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> Show Private</span>
    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 #classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="c">/*</span>
<span class="c">Copyright (c) 2007, Yahoo! Inc. All rights reserved.</span>
<span class="c">Code licensed under the BSD License:</span>
<span class="c">http://developer.yahoo.net/yui/license.txt</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c"> * @module editor</span>
<span class="c"> * @description &lt;p&gt;The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor&#39;s toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.&lt;/p&gt;</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @requires yahoo, dom, element, event, toolbar, container, menu, button</span>
<span class="c"> * @optional dragdrop, animation</span>
<span class="c"> * @beta</span>
<span class="c"> */</span>

<span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
<span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
    <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">,</span>
    <span class="nx">Toolbar</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">;</span>

    <span class="c">/**</span>
<span class="c">     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor&#39;s toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</span>
<span class="c">     * @constructor</span>
<span class="c">     * @class Editor</span>
<span class="c">     * @extends YAHOO.util.Element</span>
<span class="c">     * @param {String/HTMLElement} el The textarea element to turn into an editor.</span>
<span class="c">     * @param {Object} attrs Object liternal containing configuration parameters.</span>
<span class="c">    */</span>
    
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Editor</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">attrs</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Editor Initalizing&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>

        <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="o">{</span>
            <span class="nx">element</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
            <span class="nx">attributes</span><span class="o">:</span> <span class="o">(</span><span class="nx">attrs</span> <span class="o">||</span> <span class="o">{})</span>
        <span class="o">},</span> <span class="nx">id</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">el</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">id</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">id</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>

        <span class="k">var</span> <span class="nx">element_cont</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">element_cont</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Element</span><span class="o">(</span><span class="nx">element_cont</span><span class="o">,</span> <span class="o">{</span>
            <span class="nx">id</span><span class="o">:</span> <span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_container&#39;</span>
        <span class="o">});</span>
        <span class="k">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">div</span><span class="o">,</span> <span class="s1">&#39;first-child&#39;</span><span class="o">);</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">element_cont</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">div</span><span class="o">);</span>
        
        <span class="k">if</span> <span class="o">(!</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">toolbar_cont</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">toolbar_cont</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">toolbar_cont</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_toolbar&#39;</span><span class="o">;</span>
            <span class="nx">div</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">toolbar_cont</span><span class="o">);</span>
        <span class="o">}</span>
        
        <span class="k">var</span> <span class="nx">editorWrapper</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
        <span class="nx">div</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">editorWrapper</span><span class="o">);</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">editor_wrapper</span> <span class="o">=</span> <span class="nx">editorWrapper</span><span class="o">;</span>

        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Editor</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">constructor</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">);</span>
    <span class="o">};</span>

    <span class="c">/**</span>
<span class="c">    * @private _cleanClassName</span>
<span class="c">    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -&#39;s.</span>
<span class="c">    * @param {String} str The classname to clean up</span>
<span class="c">    * @returns {String}</span>
<span class="c">    */</span>
    <span class="k">function</span> <span class="nx">_cleanClassName</span><span class="o">(</span><span class="nx">str</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">return</span> <span class="nx">str</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">();</span>
    <span class="o">}</span>


    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Editor</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Element</span><span class="o">,</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">        * @property _lastButton</span>
<span class="c">        * @private</span>
<span class="c">        * @description The last button pressed, so we don&#39;t disable it.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_lastButton</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _baseHREF</span>
<span class="c">        * @private</span>
<span class="c">        * @description The base location of the editable page (this page) so that relative paths for image work.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">_baseHREF</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">href</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">location</span><span class="o">.</span><span class="nx">href</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">href</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;?&#39;</span><span class="o">)</span> <span class="o">!==</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Remove the query string</span>
<span class="c"></span>                <span class="nx">href</span> <span class="o">=</span> <span class="nx">href</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="nx">href</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;?&#39;</span><span class="o">));</span>
            <span class="o">}</span>
            <span class="nx">href</span> <span class="o">=</span> <span class="nx">href</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="nx">href</span><span class="o">.</span><span class="nx">lastIndexOf</span><span class="o">(</span><span class="s1">&#39;/&#39;</span><span class="o">))</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span><span class="o">;</span>
            <span class="k">return</span> <span class="nx">href</span><span class="o">;</span>
        <span class="o">}(),</span>
        <span class="c">/**</span>
<span class="c">        * @property _lastImage</span>
<span class="c">        * @private</span>
<span class="c">        * @description Safari reference for the last image selected (for styling as selected).</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_lastImage</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _blankImageLoaded</span>
<span class="c">        * @private</span>
<span class="c">        * @description Don&#39;t load the blank image more than once..</span>
<span class="c">        * @type Date</span>
<span class="c">        */</span>
        <span class="nx">_blankImageLoaded</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _fixNodesTimer</span>
<span class="c">        * @private</span>
<span class="c">        * @description Holder for the fixNodes timer</span>
<span class="c">        * @type Date</span>
<span class="c">        */</span>
        <span class="nx">_fixNodesTimer</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _nodeChangeTimer</span>
<span class="c">        * @private</span>
<span class="c">        * @description Holds a reference to the nodeChange setTimeout call</span>
<span class="c">        * @type Number</span>
<span class="c">        */</span>
        <span class="nx">_nodeChangeTimer</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _lastNodeChangeEvent</span>
<span class="c">        * @private</span>
<span class="c">        * @description Flag to determine the last event that fired a node change</span>
<span class="c">        * @type Event</span>
<span class="c">        */</span>
        <span class="nx">_lastNodeChangeEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _lastNodeChange</span>
<span class="c">        * @private</span>
<span class="c">        * @description Flag to determine when the last node change was fired</span>
<span class="c">        * @type Date</span>
<span class="c">        */</span>
        <span class="nx">_lastNodeChange</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _rendered</span>
<span class="c">        * @private</span>
<span class="c">        * @description Flag to determine if editor has been rendered or not</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">_rendered</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property DOMReady</span>
<span class="c">        * @private</span>
<span class="c">        * @description Flag to determine if DOM is ready or not</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">DOMReady</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _selection</span>
<span class="c">        * @private</span>
<span class="c">        * @description Holder for caching iframe selections</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_selection</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _mask</span>
<span class="c">        * @private</span>
<span class="c">        * @description DOM Element holder for the editor Mask when disabled</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_mask</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property _showingHiddenElements</span>
<span class="c">        * @private</span>
<span class="c">        * @description Status of the hidden elements button</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">_showingHiddenElements</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property currentWindow</span>
<span class="c">        * @description A reference to the currently open EditorWindow</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">currentWindow</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property currentEvent</span>
<span class="c">        * @description A reference to the current editor event</span>
<span class="c">        * @type Event</span>
<span class="c">        */</span>
        <span class="nx">currentEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property operaEvent</span>
<span class="c">        * @private</span>
<span class="c">        * @description setTimeout holder for Opera and Image DoubleClick event..</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">operaEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property currentFont</span>
<span class="c">        * @description A reference to the last font selected from the Toolbar</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">currentFont</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property currentElement</span>
<span class="c">        * @description A reference to the current working element in the editor</span>
<span class="c">        * @type Array</span>
<span class="c">        */</span>
        <span class="nx">currentElement</span><span class="o">:</span> <span class="o">[],</span>
        <span class="c">/**</span>
<span class="c">        * @property dompath</span>
<span class="c">        * @description A reference to the dompath container for writing the current working dom path to.</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">dompath</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property beforeElement</span>
<span class="c">        * @description A reference to the H2 placed before the editor for Accessibilty.</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">beforeElement</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property afterElement</span>
<span class="c">        * @description A reference to the H2 placed after the editor for Accessibilty.</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">afterElement</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property invalidHTML</span>
<span class="c">        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">invalidHTML</span><span class="o">:</span> <span class="o">{</span>
            <span class="nx">form</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">input</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">button</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">select</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">link</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">html</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">body</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">script</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">style</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
            <span class="nx">textarea</span><span class="o">:</span> <span class="kc">true</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @property toolbar</span>
<span class="c">        * @description Local property containing the &lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt; instance</span>
<span class="c">        * @type &lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt;</span>
<span class="c">        */</span>
        <span class="nx">toolbar</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _contentTimer</span>
<span class="c">        * @description setTimeout holder for documentReady check</span>
<span class="c">        */</span>
        <span class="nx">_contentTimer</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _contentTimerCounter</span>
<span class="c">        * @description Counter to check the number of times the body is polled for before giving up</span>
<span class="c">        * @type Number</span>
<span class="c">        */</span>
        <span class="nx">_contentTimerCounter</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _disabled</span>
<span class="c">        * @description The Toolbar items that should be disabled if there is no selection present in the editor.</span>
<span class="c">        * @type Array</span>
<span class="c">        */</span>
        <span class="nx">_disabled</span><span class="o">:</span> <span class="o">[</span> <span class="s1">&#39;createlink&#39;</span><span class="o">,</span> <span class="s1">&#39;forecolor&#39;</span><span class="o">,</span> <span class="s1">&#39;backcolor&#39;</span><span class="o">,</span> <span class="s1">&#39;fontname&#39;</span><span class="o">,</span> <span class="s1">&#39;fontsize&#39;</span><span class="o">,</span> <span class="s1">&#39;superscript&#39;</span><span class="o">,</span> <span class="s1">&#39;subscript&#39;</span><span class="o">,</span> <span class="s1">&#39;removeformat&#39;</span><span class="o">,</span> <span class="s1">&#39;heading&#39;</span><span class="o">,</span> <span class="s1">&#39;indent&#39;</span> <span class="o">],</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _alwaysDisabled</span>
<span class="c">        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_alwaysDisabled</span><span class="o">:</span> <span class="o">{</span> <span class="s1">&#39;outdent&#39;</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _alwaysEnabled</span>
<span class="c">        * @description The Toolbar items that should ALWAYS be enabled event if there isn&#39;t a selection present in the editor.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_alwaysEnabled</span><span class="o">:</span> <span class="o">{</span> <span class="nx">hiddenelements</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _semantic</span>
<span class="c">        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_semantic</span><span class="o">:</span> <span class="o">{</span> <span class="s1">&#39;bold&#39;</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="s1">&#39;italic&#39;</span> <span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="s1">&#39;underline&#39;</span> <span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _tag2cmd</span>
<span class="c">        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_tag2cmd</span><span class="o">:</span> <span class="o">{</span>
            <span class="s1">&#39;b&#39;</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span><span class="o">,</span>
            <span class="s1">&#39;strong&#39;</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span><span class="o">,</span>
            <span class="s1">&#39;i&#39;</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span><span class="o">,</span>
            <span class="s1">&#39;em&#39;</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span><span class="o">,</span>
            <span class="s1">&#39;u&#39;</span><span class="o">:</span> <span class="s1">&#39;underline&#39;</span><span class="o">,</span>
            <span class="s1">&#39;sup&#39;</span><span class="o">:</span> <span class="s1">&#39;superscript&#39;</span><span class="o">,</span>
            <span class="s1">&#39;sub&#39;</span><span class="o">:</span> <span class="s1">&#39;subscript&#39;</span><span class="o">,</span>
            <span class="s1">&#39;img&#39;</span><span class="o">:</span> <span class="s1">&#39;insertimage&#39;</span><span class="o">,</span>
            <span class="s1">&#39;a&#39;</span> <span class="o">:</span> <span class="s1">&#39;createlink&#39;</span><span class="o">,</span>
            <span class="s1">&#39;ul&#39;</span> <span class="o">:</span> <span class="s1">&#39;insertunorderedlist&#39;</span><span class="o">,</span>
            <span class="s1">&#39;ol&#39;</span> <span class="o">:</span> <span class="s1">&#39;insertorderedlist&#39;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private _createIframe</span>
<span class="c">        * @description Creates the DOM and YUI Element for the iFrame editor area.</span>
<span class="c">        * @param {String} id The string ID to prefix the iframe with</span>
<span class="c">        * @returns {Object} iFrame object</span>
<span class="c">        */</span>
        <span class="nx">_createIframe</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">ifrmDom</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">);</span>
            <span class="nx">ifrmDom</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;_editor&#39;</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">config</span> <span class="o">=</span> <span class="o">{</span>
                <span class="nx">border</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">frameBorder</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">marginWidth</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">marginHeight</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">leftMargin</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">topMargin</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span>
                <span class="nx">allowTransparency</span><span class="o">:</span> <span class="s1">&#39;true&#39;</span><span class="o">,</span>
                <span class="nx">width</span><span class="o">:</span> <span class="s1">&#39;100%&#39;</span>
            <span class="o">};</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">config</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">config</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">ifrmDom</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">i</span><span class="o">,</span> <span class="nx">config</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">isrc</span> <span class="o">=</span> <span class="s1">&#39;javascript:;&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">isrc</span> <span class="o">=</span> <span class="s1">&#39;about:blank&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="nx">ifrmDom</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">isrc</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">ifrm</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Element</span><span class="o">(</span><span class="nx">ifrmDom</span><span class="o">);</span>
            <span class="nx">ifrm</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;zIndex&#39;</span><span class="o">,</span> <span class="s1">&#39;-1&#39;</span><span class="o">);</span>
            <span class="k">return</span> <span class="nx">ifrm</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private _isElement</span>
<span class="c">        * @description Checks to see if an Element reference is a valid one and has a certain tag type</span>
<span class="c">        * @param {HTMLElement} el The element to check</span>
<span class="c">        * @param {String} tag The tag that the element needs to be</span>
<span class="c">        * @returns {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">_isElement</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">tag</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">tag</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="nx">tag</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getDoc</span>
<span class="c">        * @description Get the Document of the IFRAME</span>
<span class="c">        * @return {Object}</span>
<span class="c">        */</span>
        <span class="nx">_getDoc</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">try</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">contentWindow</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">contentWindow</span><span class="o">.</span><span class="nb">document</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">contentWindow</span><span class="o">.</span><span class="nb">document</span><span class="o">;</span>
                                        <span class="k">return</span> <span class="nx">value</span><span class="o">;</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getWindow</span>
<span class="c">        * @description Get the Window of the IFRAME</span>
<span class="c">        * @return {Object}</span>
<span class="c">        */</span>
        <span class="nx">_getWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">contentWindow</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _focusWindow</span>
<span class="c">        * @description Attempt to set the focus of the iframes window.</span>
<span class="c">        * @param {Boolean} onLoad Safari needs some special care to set the cursor in the iframe</span>
<span class="c">        */</span>
        <span class="nx">_focusWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">onLoad</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">onLoad</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue Safari Cursor Position</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * @description Can&#39;t get Safari to place the cursor at the beginning of the text..</span>
<span class="c">                    * This workaround at least set&#39;s the toolbar into the proper state.</span>
<span class="c">                    */</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapseToStart</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="m">1</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapseToStart</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">focus</span><span class="o">();</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">focus</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _hasSelection</span>
<span class="c">        * @description Determines if there is a selection in the editor document.</span>
<span class="c">        * @returns {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">_hasSelection</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">();</span>
            <span class="k">var</span> <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">();</span>
            <span class="k">var</span> <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

            <span class="c">//Internet Explorer</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">.</span><span class="nx">text</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">.</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span><span class="o">+</span><span class="s1">&#39;&#39;</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">toString</span><span class="o">()</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">sel</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">hasSel</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getSelection</span>
<span class="c">        * @description Handles the different selection objects across the A-Grade list.</span>
<span class="c">        * @returns {Object} Selection Object</span>
<span class="c">        */</span>
        <span class="nx">_getSelection</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">_sel</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">())</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">selection</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">selection</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">getSelection</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="c">//Handle Safari&#39;s lack of Selection Object</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">_sel</span><span class="o">.</span><span class="nx">baseNode</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span> <span class="o">=</span> <span class="o">{};</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">baseNode</span> <span class="o">=</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">baseNode</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">baseOffset</span> <span class="o">=</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">baseOffset</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">extentNode</span> <span class="o">=</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">extentNode</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">extentOffset</span> <span class="o">=</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">extentOffset</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_selection</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">getSelection</span><span class="o">();</span>
                        <span class="nx">_sel</span><span class="o">.</span><span class="nx">setBaseAndExtent</span><span class="o">(</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">baseNode</span><span class="o">,</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">baseOffset</span><span class="o">,</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">extentNode</span><span class="o">,</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span><span class="o">.</span><span class="nx">extentOffset</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_selection</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">_sel</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _selectNode</span>
<span class="c">        * @description Places the highlight around a given node</span>
<span class="c">        * @param {HTMLElement} node The node to select</span>
<span class="c">        */</span>
        <span class="nx">_selectNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">(),</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">try</span> <span class="o">{</span> <span class="c">//IE freaks out here sometimes..</span>
<span class="c"></span>                    <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">createTextRange</span><span class="o">();</span>
                    <span class="nx">range</span><span class="o">.</span><span class="nx">moveToElementText</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>
                    <span class="nx">range</span><span class="o">.</span><span class="nx">select</span><span class="o">();</span>
                <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">sel</span><span class="o">.</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="nx">node</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="nx">node</span><span class="o">,</span> <span class="nx">node</span><span class="o">.</span><span class="nx">innerText</span><span class="o">.</span><span class="nx">length</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createRange</span><span class="o">();</span>
                <span class="nx">range</span><span class="o">.</span><span class="nx">selectNodeContents</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>
                <span class="nx">sel</span><span class="o">.</span><span class="nx">removeAllRanges</span><span class="o">();</span>
                <span class="nx">sel</span><span class="o">.</span><span class="nx">addRange</span><span class="o">(</span><span class="nx">range</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getRange</span>
<span class="c">        * @description Handles the different range objects across the A-Grade list.</span>
<span class="c">        * @returns {Object} Range Object</span>
<span class="c">        */</span>
        <span class="nx">_getRange</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">();</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">sel</span><span class="o">.</span><span class="nx">getRangeAt</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createRange</span><span class="o">();</span>
                <span class="k">try</span> <span class="o">{</span>
                    <span class="nx">_range</span><span class="o">.</span><span class="nx">setStart</span><span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">,</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">anchorOffset</span><span class="o">);</span>
                    <span class="nx">_range</span><span class="o">.</span><span class="nx">setEnd</span><span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">focusNode</span><span class="o">,</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">focusOffset</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">getSelection</span><span class="o">()+</span><span class="s1">&#39;&#39;</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">return</span> <span class="nx">_range</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">createRange</span><span class="o">();</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">rangeCount</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">getRangeAt</span><span class="o">(</span><span class="m">0</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setDesignMode</span>
<span class="c">        * @description Sets the designMode of the iFrame document.</span>
<span class="c">        * @param {String} state This should be either on or off</span>
<span class="c">        */</span>
        <span class="nx">_setDesignMode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">state</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">designMode</span> <span class="o">=</span> <span class="nx">state</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">catch</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _toggleDesignMode</span>
<span class="c">        * @description Toggles the designMode of the iFrame document on and off.</span>
<span class="c">        * @returns {String} The state that it was set to.</span>
<span class="c">        */</span>
        <span class="nx">_toggleDesignMode</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">_dMode</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">designMode</span><span class="o">,</span>
                <span class="nx">_state</span> <span class="o">=</span> <span class="s1">&#39;on&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">_dMode</span> <span class="o">==</span> <span class="s1">&#39;on&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_state</span> <span class="o">=</span> <span class="s1">&#39;off&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setDesignMode</span><span class="o">(</span><span class="nx">_state</span><span class="o">);</span>
            <span class="k">return</span> <span class="nx">_state</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _initEditor</span>
<span class="c">        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set&#39;s up the listeners.</span>
<span class="c">        */</span>
        <span class="nx">_initEditor</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;editorLoaded&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">margin</span> <span class="o">=</span> <span class="s1">&#39;0&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setDesignMode</span><span class="o">(</span><span class="s1">&#39;on&#39;</span><span class="o">);</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;buttonClick&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleToolbarClick</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="c">//Setup Listeners on iFrame</span>
<span class="c"></span>            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;mouseup&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleMouseUp</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleMouseDown</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleClick</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;dblclick&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleDoubleClick</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;keypress&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleKeyPress</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;keyup&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleKeyUp</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span> <span class="s1">&#39;keydown&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleKeyDown</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorContentLoaded&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorLoaded&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;dompath&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Delayed DomPath write&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">_writeDomPath</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                <span class="o">},</span> <span class="m">150</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setBusy</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _checkLoaded</span>
<span class="c">        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.</span>
<span class="c">        */</span>
        <span class="nx">_checkLoaded</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_contentTimerCounter</span><span class="o">++;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_contentTimer</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_contentTimer</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_contentTimerCounter</span> <span class="o">&gt;</span> <span class="m">250</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;ERROR: Body Did Not load&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">init</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">_rteLoaded</span> <span class="o">===</span> <span class="kc">true</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">init</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">init</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;checking body (e)&#39;</span> <span class="o">+</span> <span class="nx">e</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">init</span> <span class="o">===</span> <span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">//The onload event has fired, clean up after ourselves and fire the _initEditor method</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">_initEditor</span><span class="o">();</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_contentTimer</span> <span class="o">=</span> <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">_checkLoaded</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                <span class="o">},</span> <span class="m">20</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setInitialContent</span>
<span class="c">        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.</span>
<span class="c">        */</span>
        <span class="nx">_setInitialContent</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Populating editor body with contents of the text area&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">substitute</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;html&#39;</span><span class="o">),</span> <span class="o">{</span>
                <span class="nx">TITLE</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_TITLE</span><span class="o">,</span>
                <span class="nx">CONTENT</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">value</span><span class="o">,</span>
                <span class="nx">CSS</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;css&#39;</span><span class="o">),</span>
                <span class="nx">HIDDEN_CSS</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;hiddencss&#39;</span><span class="o">)</span>
            <span class="o">}),</span>
            <span class="nx">check</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">try</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">open</span><span class="o">();</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">write</span><span class="o">(</span><span class="nx">html</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">close</span><span class="o">();</span>
                <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Setting doc failed.. (_setInitialContent)&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                    <span class="c">//Safari will only be here if we are hidden</span>
<span class="c"></span>                    <span class="nx">check</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="c">//This keeps Firefox from writing the iframe to history preserving the back buttons functionality</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">src</span> <span class="o">=</span> <span class="s1">&#39;data:text/html;charset=utf-8,&#39;</span> <span class="o">+</span> <span class="nb">encodeURIComponent</span><span class="o">(</span><span class="nx">html</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">check</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_checkLoaded</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setMarkupType</span>
<span class="c">        * @param {String} action The action to take. Possible values are: css, default or semantic</span>
<span class="c">        * @description This method will turn on/off the useCSS execCommand.</span>
<span class="c">        */</span>
        <span class="nx">_setMarkupType</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">action</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">switch</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;markup&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="s1">&#39;css&#39;</span><span class="o">:</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;default&#39;</span><span class="o">:</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;semantic&#39;</span><span class="o">:</span>
                <span class="nx">case</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_semantic</span><span class="o">[</span><span class="nx">action</span><span class="o">])</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * Set the editor to use CSS instead of HTML</span>
<span class="c">        * @param {Booleen} stat True/False</span>
<span class="c">        */</span>
        <span class="nx">_setEditorStyle</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">stat</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;useCSS&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="o">!</span><span class="nx">stat</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">ex</span><span class="o">)</span> <span class="o">{</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getSelectedElement</span>
<span class="c">        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.</span>
<span class="c">        * @returns {HTMLElement} The currently selected element.</span>
<span class="c">        */</span>
        <span class="nx">_getSelectedElement</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">(),</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">sel</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">event</span><span class="o">;</span> <span class="c">//Event utility assumes window.event, so we need to reset it to this._getWindow().event;</span>
<span class="c"></span>                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="o">.</span><span class="nx">item</span> <span class="o">?</span> <span class="nx">range</span><span class="o">.</span><span class="nx">item</span><span class="o">(</span><span class="m">0</span><span class="o">)</span> <span class="o">:</span> <span class="nx">range</span><span class="o">.</span><span class="nx">parentElement</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">elm</span> <span class="o">==</span> <span class="nx">doc</span><span class="o">.</span><span class="nx">body</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="m">0</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">();</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">();</span>

                <span class="k">if</span> <span class="o">(!</span><span class="nx">sel</span> <span class="o">||</span> <span class="o">!</span><span class="nx">range</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">3</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span> <span class="c">//next check parentNode</span>
<span class="c"></span>                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">.</span><span class="nx">nextSibling</span> <span class="o">!=</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">focusNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">sel</span><span class="o">.</span><span class="nx">anchorNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;br&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">}</span>
                
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">elm</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="o">.</span><span class="nx">commonAncestorContainer</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="nx">range</span><span class="o">.</span><span class="nx">collapsed</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">.</span><span class="nx">startContainer</span> <span class="o">==</span> <span class="nx">range</span><span class="o">.</span><span class="nx">endContainer</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">.</span><span class="nx">startOffset</span> <span class="o">-</span> <span class="nx">range</span><span class="o">.</span><span class="nx">endOffset</span> <span class="o">&lt;</span> <span class="m">2</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">if</span> <span class="o">(</span><span class="nx">range</span><span class="o">.</span><span class="nx">startContainer</span><span class="o">.</span><span class="nx">hasChildNodes</span><span class="o">())</span> <span class="o">{</span>
                                        <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="o">.</span><span class="nx">startContainer</span><span class="o">.</span><span class="nx">childNodes</span><span class="o">[</span><span class="nx">range</span><span class="o">.</span><span class="nx">startOffset</span><span class="o">];</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">switch</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">.</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">case</span> <span class="s1">&#39;click&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;mouseup&#39;</span><span class="o">:</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">);</span>
                        <span class="k">break</span><span class="o">;</span>
                    <span class="nx">default</span><span class="o">:</span>
                        <span class="c">//Do nothing</span>
<span class="c"></span>                        <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">elm</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(!</span><span class="nx">elm</span> <span class="o">||</span> <span class="o">!</span><span class="nx">elm</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;html&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="c">//Safari sometimes gives us the HTML node back..</span>
<span class="c"></span>                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="c">//make sure that body means this body not the parent..</span>
<span class="c"></span>                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">elm</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">elm</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Not in document</span>
<span class="c"></span>                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">elm</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">elm</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getDomPath</span>
<span class="c">        * @description This method will attempt to build the DOM path from the currently selected element.</span>
<span class="c">        * @returns {Array} An array of node references that will create the DOM Path.</span>
<span class="c">        */</span>
        <span class="nx">_getDomPath</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
			<span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
			<span class="k">var</span> <span class="nx">domPath</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="k">while</span> <span class="o">(</span><span class="nx">el</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">ownerDocument</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">())</span> <span class="o">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="c">//Check to see if we get el.nodeName and nodeType</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">1</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">domPath</span><span class="o">[</span><span class="nx">domPath</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                <span class="o">}</span>

                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>

                <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">domPath</span><span class="o">.</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">domPath</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">domPath</span><span class="o">.</span><span class="nx">reverse</span><span class="o">();</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _writeDomPath</span>
<span class="c">        * @description Write the current DOM path out to the dompath container below the editor.</span>
<span class="c">        */</span>
        <span class="nx">_writeDomPath</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
            <span class="k">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDomPath</span><span class="o">(),</span>
                <span class="nx">pathArr</span> <span class="o">=</span> <span class="o">[],</span>
                <span class="nx">classPath</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">tag</span> <span class="o">==</span> <span class="s1">&#39;ol&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">type</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">tag</span> <span class="o">+=</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">type</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;yui-tag&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;markup&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;markup&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">switch</span> <span class="o">(</span><span class="nx">tag</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">case</span> <span class="s1">&#39;b&#39;</span><span class="o">:</span> <span class="nx">tag</span> <span class="o">=</span> <span class="s1">&#39;strong&#39;</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;i&#39;</span><span class="o">:</span> <span class="nx">tag</span> <span class="o">=</span> <span class="s1">&#39;em&#39;</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;yui-tag&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="nx">tag</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">classPath</span> <span class="o">=</span> <span class="o">((</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">className</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;.&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">className</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;.&#39;</span><span class="o">)</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">((</span><span class="nx">classPath</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;yui&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">classPath</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;apple-style-span&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">classPath</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="nx">tag</span> <span class="o">+</span> <span class="o">((</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">id</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">id</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="nx">classPath</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">switch</span> <span class="o">(</span><span class="nx">tag</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">case</span> <span class="s1">&#39;a&#39;</span><span class="o">:</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="nx">pathStr</span> <span class="o">+=</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;mailto:&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;https:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span> <span class="c">//May need to add others here ftp</span>
<span class="c"></span>                            <span class="o">}</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;img&#39;</span><span class="o">:</span>
                            <span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">height</span><span class="o">;</span>
                            <span class="k">var</span> <span class="nx">w</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">width</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">h</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                            <span class="o">}</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">w</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                            <span class="o">}</span>
                            <span class="nx">pathStr</span> <span class="o">+=</span> <span class="s1">&#39;(&#39;</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s1">&#39;x&#39;</span> <span class="o">+</span> <span class="nx">w</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">;</span>
                        <span class="k">break</span><span class="o">;</span>
                    <span class="o">}</span>

                    <span class="k">if</span> <span class="o">(</span><span class="nx">pathStr</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">10</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&lt;span title=&quot;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;...&#39;</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&lt;span title=&quot;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">pathArr</span><span class="o">[</span><span class="nx">pathArr</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">pathStr</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="nx">pathArr</span><span class="o">.</span><span class="nx">join</span><span class="o">(</span><span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">SEP_DOMPATH</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span><span class="o">);</span>
            <span class="c">//Prevent flickering</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">!=</span> <span class="nx">str</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _fixNodes</span>
<span class="c">        * @description Fix href and imgs as well as remove invalid HTML.</span>
<span class="c">        */</span>
        <span class="nx">_fixNodes</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">v</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">invalidHTML</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">invalidHTML</span><span class="o">,</span> <span class="nx">v</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">tags</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="nx">v</span><span class="o">);</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="nx">tags</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">h</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">tags</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">tags</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">tags</span><span class="o">[</span><span class="nx">h</span><span class="o">]);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">imgs</span><span class="o">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="o">);</span>
            
            <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>

            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">im</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">im</span> <span class="o">&lt;</span> <span class="nx">imgs</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">im</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">im</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="nx">imgs</span><span class="o">[</span><span class="nx">im</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">im</span><span class="o">],</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_LOCAL_FILE</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">im</span><span class="o">],</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_LOCAL_FILE</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">fakeAs</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">a</span> <span class="o">&lt;</span> <span class="nx">fakeAs</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">a</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">fakeAs</span><span class="o">[</span><span class="nx">a</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="nx">fakeAs</span><span class="o">[</span><span class="nx">a</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">fakeAs</span><span class="o">[</span><span class="nx">a</span><span class="o">],</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_LOCAL_FILE</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">fakeAs</span><span class="o">[</span><span class="nx">a</span><span class="o">],</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_LOCAL_FILE</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _showHidden</span>
<span class="c">        * @description Toggle on/off the hidden.css file.</span>
<span class="c">        */</span>
        <span class="nx">_showHidden</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_showingHiddenElements</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Enabling hidden CSS File&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_showingHiddenElements</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">deselectButton</span><span class="o">(</span><span class="s1">&#39;hiddenelements&#39;</span><span class="o">);</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_HIDDEN</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Disabling hidden CSS File&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_showingHiddenElements</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_HIDDEN</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;hiddenelements&#39;</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setCurrentEvent</span>
<span class="c">        * @param {Event} ev The event to cache</span>
<span class="c">        * @description Sets the current event property</span>
<span class="c">        */</span>
        <span class="nx">_setCurrentEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="nx">ev</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleClick</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all click events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleClick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">tar</span> <span class="o">=</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">tar</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">tar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleMouseUp</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all mouseup events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleMouseUp</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">/**</span>
<span class="c">                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..</span>
<span class="c">                * @browser Opera</span>
<span class="c">                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.</span>
<span class="c">                */</span>
                <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">operaEvent</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">operaEvent</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_handleDoubleClick</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="nx">self</span><span class="o">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">},</span> <span class="m">700</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="c">//This will stop Safari from selecting the entire document if you select all the text in the editor</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorMouseUp&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorMouseUp&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleMouseDown</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all mousedown events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleMouseDown</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_sel</span><span class="o">.</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">_sel</span><span class="o">.</span><span class="nx">collapseToStart</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">,</span> <span class="s1">&#39;selected&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;selected&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="nx">sel</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorMouseDown&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorMouseDown&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleDoubleClick</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all doubleclick events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleDoubleClick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">sel</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;insertimageClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;insertimageClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">});</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">sel</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">sel</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;createlinkClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">});</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorDoubleClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorDoubleClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleKeyUp</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all keyup events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleKeyUp</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="nx">switch</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="m">37</span><span class="o">:</span> <span class="c">//Left Arrow</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">38</span><span class="o">:</span> <span class="c">//Up Arrow</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">39</span><span class="o">:</span> <span class="c">//Right Arrow</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">40</span><span class="o">:</span> <span class="c">//Down Arrow</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">46</span><span class="o">:</span> <span class="c">//Forward Delete</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">8</span><span class="o">:</span> <span class="c">//Delete</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">87</span><span class="o">:</span> <span class="c">//W key if window is open</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">((</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">87</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">ctrlKey</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span><span class="o">);</span>
                            <span class="o">}</span>
                            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                                <span class="nx">self</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                                <span class="nx">self</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                            <span class="o">},</span> <span class="m">100</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorKeyUp&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyUp&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleKeyPress</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all keypress events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleKeyPress</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorKeyPress&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyPress&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleKeyDown</span>
<span class="c">        * @param {Event} ev The event we are working on.</span>
<span class="c">        * @description Handles all keydown events inside the iFrame document.</span>
<span class="c">        */</span>
        <span class="nx">_handleKeyDown</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setCurrentEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">action</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">ctrlKey</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="nx">switch</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="m">84</span><span class="o">:</span> <span class="c">//Focus Toolbar Header -- Ctrl + Shift + T</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">ctrlKey</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">27</span><span class="o">:</span> <span class="c">//Focus After Element - Ctrl + Shift + Esc</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">219</span><span class="o">:</span> <span class="c">//Left</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;justifyleft&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">220</span><span class="o">:</span> <span class="c">//Center</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;justifycenter&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">221</span><span class="o">:</span> <span class="c">//Right</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;justifyright&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">76</span><span class="o">:</span> <span class="c">//L</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">ctrlKey</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;createlink&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;createlinkClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">});</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
                            <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">65</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">metaKey</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                        <span class="c">//Override Safari&#39;s select all and select the contents of the editor not the iframe as Safari would by default.</span>
<span class="c"></span>                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="m">1</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">.</span><span class="nx">length</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">66</span><span class="o">:</span> <span class="c">//B</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;bold&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">73</span><span class="o">:</span> <span class="c">//I</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;italic&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">85</span><span class="o">:</span> <span class="c">//U</span>
<span class="c"></span>                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;underline&#39;</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">9</span><span class="o">:</span> <span class="c">//Tab Key</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">safari</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;inserttext&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="s1">&#39;\t&#39;</span><span class="o">);</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">13</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//Insert a &lt;br&gt; instead of a &lt;p&gt;&lt;/p&gt; in Internet Explorer</span>
<span class="c"></span>                        <span class="k">var</span> <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">();</span>
                        <span class="k">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">tar</span><span class="o">,</span> <span class="s1">&#39;li&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">_range</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_range</span><span class="o">.</span><span class="nx">pasteHTML</span><span class="o">(</span><span class="s1">&#39;&lt;br&gt;&#39;</span><span class="o">);</span>
                                <span class="nx">_range</span><span class="o">.</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
                                <span class="nx">_range</span><span class="o">.</span><span class="nx">select</span><span class="o">();</span>
                            <span class="o">}</span>
                            <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">doExec</span> <span class="o">&amp;&amp;</span> <span class="nx">action</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">action</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;editorKeyDown&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyDown&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method nodeChange</span>
<span class="c">        * @param {Boolean} force Optional paramenter to skip the threshold counter</span>
<span class="c">        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.</span>
<span class="c">        */</span>
        <span class="nx">nodeChange</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">force</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">threshold</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;nodeChangeThreshold&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">thisNodeChange</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="k">new</span> <span class="nb">Date</span><span class="o">().</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">/</span> <span class="m">1000</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">force</span> <span class="o">===</span> <span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastNodeChange</span> <span class="o">+</span> <span class="nx">threshold</span><span class="o">)</span> <span class="o">&lt;</span> <span class="nx">thisNodeChange</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_fixNodesTimer</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="nx">self</span><span class="o">.</span><span class="nx">_fixNodes</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                        <span class="nx">self</span><span class="o">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">},</span> <span class="m">0</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="nx">thisNodeChange</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_lastNodeChangeEvent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">.</span><span class="nx">type</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">var</span> <span class="nx">beforeNodeChange</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;beforeNodeChange&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeNodeChange&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">beforeNodeChange</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;dompath&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_writeDomPath</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="c">//Check to see if we are disabled before continuing</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STOP_NODE_CHANGE</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">//Reset this var for next action</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">STOP_NODE_CHANGE</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">(),</span>
                        <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">(),</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">(),</span>
                        <span class="nx">fn_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;fontname&#39;</span><span class="o">),</span>
                        <span class="nx">fs_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;fontsize&#39;</span><span class="o">);</span>

                    <span class="c">//Handle updating the toolbar with active buttons</span>
<span class="c"></span>                    <span class="k">var</span> <span class="nx">_ex</span> <span class="o">=</span> <span class="o">{};</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">_ex</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span><span class="o">.</span><span class="nx">id</span><span class="o">]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">fn_button</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">_ex</span><span class="o">[</span><span class="nx">fn_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">fs_button</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">_ex</span><span class="o">[</span><span class="nx">fs_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">resetAllButtons</span><span class="o">(</span><span class="nx">_ex</span><span class="o">);</span>

                    <span class="c">//Handle disabled buttons</span>
<span class="c"></span>                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">d</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">d</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">d</span><span class="o">]);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">_button</span> <span class="o">&amp;&amp;</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">===</span> <span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span><span class="o">.</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                                <span class="c">//Skip</span>
<span class="c"></span>                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                                    <span class="nx">switch</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">d</span><span class="o">])</span> <span class="o">{</span>
                                        <span class="nx">case</span> <span class="s1">&#39;fontname&#39;</span><span class="o">:</span>
                                        <span class="nx">case</span> <span class="s1">&#39;fontsize&#39;</span><span class="o">:</span>
                                            <span class="k">break</span><span class="o">;</span>
                                        <span class="nx">default</span><span class="o">:</span>
                                            <span class="c">//No Selection - disable</span>
<span class="c"></span>                                            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                                    <span class="o">}</span>
                                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_alwaysDisabled</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">d</span><span class="o">]])</span> <span class="o">{</span>
                                        <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_alwaysEnabled</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">d</span><span class="o">]])</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">deselectButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDomPath</span><span class="o">();</span>
                    <span class="k">var</span> <span class="nx">olType</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span> <span class="nx">tag</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">();</span>
                        <span class="o">}</span>
                        <span class="nx">cmd</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_tag2cmd</span><span class="o">[</span><span class="nx">tag</span><span class="o">];</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">cmd</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">cmd</span> <span class="o">=</span> <span class="o">[];</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">cmd</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">cmd</span> <span class="o">=</span> <span class="o">[</span><span class="nx">cmd</span><span class="o">];</span>
                        <span class="o">}</span>

                        <span class="c">//Bold and Italic styles</span>
<span class="c"></span>                        <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">fontWeight</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;bold&#39;</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">cmd</span><span class="o">[</span><span class="nx">cmd</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;bold&#39;</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">fontStyle</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;italic&#39;</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">cmd</span><span class="o">[</span><span class="nx">cmd</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;italic&#39;</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">textDecoration</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;underline&#39;</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">cmd</span><span class="o">[</span><span class="nx">cmd</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;underline&#39;</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">cmd</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">cmd</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="nx">cmd</span><span class="o">[</span><span class="nx">j</span><span class="o">]);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">cmd</span><span class="o">[</span><span class="nx">j</span><span class="o">]);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="c">//Handle Alignment</span>
<span class="c"></span>                        <span class="nx">switch</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">textAlign</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                            <span class="nx">case</span> <span class="s1">&#39;left&#39;</span><span class="o">:</span>
                            <span class="nx">case</span> <span class="s1">&#39;right&#39;</span><span class="o">:</span>
                            <span class="nx">case</span> <span class="s1">&#39;center&#39;</span><span class="o">:</span>
                            <span class="nx">case</span> <span class="s1">&#39;justify&#39;</span><span class="o">:</span>
                                <span class="k">var</span> <span class="nx">alignType</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">textAlign</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
                                <span class="k">if</span> <span class="o">(</span><span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">textAlign</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;justify&#39;</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="nx">alignType</span> <span class="o">=</span> <span class="s1">&#39;full&#39;</span><span class="o">;</span>
                                <span class="o">}</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;justify&#39;</span> <span class="o">+</span> <span class="nx">alignType</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;justify&#39;</span> <span class="o">+</span> <span class="nx">alignType</span><span class="o">);</span>
                                <span class="k">break</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="c">//After for loop</span>
<span class="c"></span>
                    <span class="c">//Reset Font Family and Size to the inital configs</span>
<span class="c"></span>                    <span class="k">if</span> <span class="o">(</span><span class="nx">fn_button</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="k">label</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                        <span class="nx">fn_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-fontname-&#39;</span> <span class="o">+</span> <span class="nx">_cleanClassName</span><span class="o">(</span><span class="nx">family</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">family</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;fontname&#39;</span><span class="o">,</span> <span class="nx">family</span><span class="o">);</span>
                    <span class="o">}</span>

                    <span class="k">if</span> <span class="o">(</span><span class="nx">fs_button</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">fs_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="nx">fs_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="k">label</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                    <span class="o">}</span>

                    <span class="k">var</span> <span class="nx">hd_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;heading&#39;</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">hd_button</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">hd_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="nx">hd_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="k">label</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;heading&#39;</span><span class="o">,</span> <span class="s1">&#39;none&#39;</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">img_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">img_button</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">.</span><span class="nx">name</span> <span class="o">==</span> <span class="s1">&#39;insertimage&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="nx">img_button</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterNodeChange&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _updateMenuChecked</span>
<span class="c">        * @param {Object} button The command identifier of the button you want to check</span>
<span class="c">        * @param {String} value The value of the menu item you want to check</span>
<span class="c">        * @param {&lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt;} The Toolbar instance the button belongs to (defaults to this.toolbar) </span>
<span class="c">        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.</span>
<span class="c">        */</span>
        <span class="nx">_updateMenuChecked</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">button</span><span class="o">,</span> <span class="nx">value</span><span class="o">,</span> <span class="nx">tbar</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">tbar</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">tbar</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="nx">tbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">button</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">_menuItems</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">getItems</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">_menuItems</span><span class="o">.</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_button</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">_onBeforeShow</span><span class="o">();</span>
                <span class="nx">_menuItems</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">getItems</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">_menuItems</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">_menuItems</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">_menuItems</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_menuItems</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleToolbarClick</span>
<span class="c">        * @param {Event} ev The event that triggered the button click</span>
<span class="c">        * @description This is an event handler attached to the Toolbar&#39;s buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.</span>
<span class="c">        */</span>
        <span class="nx">_handleToolbarClick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="nx">cmd</span><span class="o">;</span>
                <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span> <span class="o">=</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">button</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;NOEXEC::execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">cmd</span> <span class="o">+</span> <span class="s1">&#39;), (&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">cmd</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                     <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                     <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                         <span class="nx">self</span><span class="o">.</span><span class="nx">_focusWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                     <span class="o">},</span> <span class="m">5</span><span class="o">);</span>
                 <span class="o">}</span>
            <span class="o">}</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setupAfterElement</span>
<span class="c">        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.</span>
<span class="c">        */</span>
        <span class="nx">_setupAfterElement</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h2&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-editor-skipheader&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="s1">&#39;-1&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LEAVE_EDITOR</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">afterElement</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @property EDITOR_PANEL_ID</span>
<span class="c">        * @description HTML id to give the properties window in the DOM.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">EDITOR_PANEL_ID</span><span class="o">:</span> <span class="s1">&#39;yui-editor-panel&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property SEP_DOMPATH</span>
<span class="c">        * @description The value to place in between the Dom path items</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">SEP_DOMPATH</span><span class="o">:</span> <span class="s1">&#39;&lt;&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LEAVE_EDITOR</span>
<span class="c">        * @description The accessibility string for the element after the iFrame</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LEAVE_EDITOR</span><span class="o">:</span> <span class="s1">&#39;You have left the Rich Text Editor.&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_BEFORE_EDITOR</span>
<span class="c">        * @description The accessibility string for the element before the iFrame</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_BEFORE_EDITOR</span><span class="o">:</span> <span class="s1">&#39;This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. &lt;h4&gt;Common formatting keyboard shortcuts:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Control Shift B sets text to bold&lt;/li&gt; &lt;li&gt;Control Shift I sets text to italic&lt;/li&gt; &lt;li&gt;Control Shift U underlines text&lt;/li&gt; &lt;li&gt;Control Shift [ aligns text left&lt;/li&gt; &lt;li&gt;Control Shift | centers text&lt;/li&gt; &lt;li&gt;Control Shift ] aligns text right&lt;/li&gt; &lt;li&gt;Control Shift L adds an HTML link&lt;/li&gt; &lt;li&gt;To exit this text editor use the keyboard shortcut Control + Shift + ESC.&lt;/li&gt;&lt;/ul&gt;&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_CLOSE_WINDOW</span>
<span class="c">        * @description The Title of the close button in the Editor Window</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_CLOSE_WINDOW</span><span class="o">:</span> <span class="s1">&#39;Close Window&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_CLOSE_WINDOW_NOTE</span>
<span class="c">        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_CLOSE_WINDOW_NOTE</span><span class="o">:</span> <span class="s1">&#39;To close this window use the Control + Shift + W key&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_TITLE</span>
<span class="c">        * @description The Title of the HTML document that is created in the iFrame</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_TITLE</span><span class="o">:</span> <span class="s1">&#39;Rich Text Area.&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_HERE</span>
<span class="c">        * @description The text to place in the URL textbox when using the blankimage.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_HERE</span><span class="o">:</span> <span class="s1">&#39;Image Url Here&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_PROP_TITLE</span>
<span class="c">        * @description The title for the Image Property Editor Window</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_PROP_TITLE</span><span class="o">:</span> <span class="s1">&#39;Image Options&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_URL</span>
<span class="c">        * @description The label string for Image URL</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_URL</span><span class="o">:</span> <span class="s1">&#39;Image Url&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_TITLE</span>
<span class="c">        * @description The label string for Image Description</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_TITLE</span><span class="o">:</span> <span class="s1">&#39;Description&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_SIZE</span>
<span class="c">        * @description The label string for Image Size</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_SIZE</span><span class="o">:</span> <span class="s1">&#39;Size&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_ORIG_SIZE</span>
<span class="c">        * @description The label string for Original Image Size</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_ORIG_SIZE</span><span class="o">:</span> <span class="s1">&#39;Original Size&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_COPY</span>
<span class="c">        * @description The label string for the image copy and paste message for Opera and Safari</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_COPY</span><span class="o">:</span> <span class="s1">&#39;&lt;span class=&quot;tip&quot;&gt;&lt;span class=&quot;icon icon-info&quot;&gt;&lt;/span&gt;&lt;strong&gt;Note:&lt;/strong&gt;To move this image just highlight it, cut, and paste where ever you\&#39;d like.&lt;/span&gt;&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_PADDING</span>
<span class="c">        * @description The label string for the image padding.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_PADDING</span><span class="o">:</span> <span class="s1">&#39;Padding&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_BORDER</span>
<span class="c">        * @description The label string for the image border.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_BORDER</span><span class="o">:</span> <span class="s1">&#39;Border&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_IMAGE_TEXTFLOW</span>
<span class="c">        * @description The label string for the image text flow.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_IMAGE_TEXTFLOW</span><span class="o">:</span> <span class="s1">&#39;Text Flow&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LOCAL_FILE_WARNING</span>
<span class="c">        * @description The label string for the local file warning.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LOCAL_FILE_WARNING</span><span class="o">:</span> <span class="s1">&#39;&lt;span class=&quot;tip&quot;&gt;&lt;span class=&quot;icon icon-warn&quot;&gt;&lt;/span&gt;&lt;strong&gt;Note:&lt;/strong&gt;This image/link points to a file on your computer and will not be accessible to others on the internet.&lt;/span&gt;&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LINK_PROP_TITLE</span>
<span class="c">        * @description The label string for the Link Property Editor Window.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LINK_PROP_TITLE</span><span class="o">:</span> <span class="s1">&#39;Link Options&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LINK_PROP_REMOVE</span>
<span class="c">        * @description The label string for the Remove link from text link inside the property editor.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LINK_PROP_REMOVE</span><span class="o">:</span> <span class="s1">&#39;Remove link from text&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LINK_URL</span>
<span class="c">        * @description The label string for the Link URL.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LINK_URL</span><span class="o">:</span> <span class="s1">&#39;Link URL&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LINK_NEW_WINDOW</span>
<span class="c">        * @description The string for the open in a new window label.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LINK_NEW_WINDOW</span><span class="o">:</span> <span class="s1">&#39;Open in a new window.&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @property STR_LINK_TITLE</span>
<span class="c">        * @description The string for the link description.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_LINK_TITLE</span><span class="o">:</span> <span class="s1">&#39;Description&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property STOP_EXEC_COMMAND</span>
<span class="c">        * @description Set to true when you want the default execCommand function to not process anything</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">STOP_EXEC_COMMAND</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property STOP_NODE_CHANGE</span>
<span class="c">        * @description Set to true when you want the default nodeChange function to not process anything</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">STOP_NODE_CHANGE</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_HIDDEN</span>
<span class="c">        * @description CSS class applied to the body when the hiddenelements button is pressed.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_HIDDEN</span><span class="o">:</span> <span class="s1">&#39;hidden&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_LOCAL_FILE</span>
<span class="c">        * @description CSS class applied to an element when it&#39;s found to have a local url.</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_LOCAL_FILE</span><span class="o">:</span> <span class="s1">&#39;warning-localfile&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_CONTAINER</span>
<span class="c">        * @description Default CSS class to apply to the editors container element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_CONTAINER</span><span class="o">:</span> <span class="s1">&#39;yui-editor-container&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_EDITABLE</span>
<span class="c">        * @description Default CSS class to apply to the editors iframe element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_EDITABLE</span><span class="o">:</span> <span class="s1">&#39;yui-editor-editable&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_EDITABLE_CONT</span>
<span class="c">        * @description Default CSS class to apply to the editors iframe&#39;s parent element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_EDITABLE_CONT</span><span class="o">:</span> <span class="s1">&#39;yui-editor-editable-container&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_PREFIX</span>
<span class="c">        * @description Default prefix for dynamically created class names</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_PREFIX</span><span class="o">:</span> <span class="s1">&#39;yui-editor&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property browser</span>
<span class="c">        * @description Standard browser detection</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">browser</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">br</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">;</span>
            <span class="c">//Check for webkit3</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">br</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&gt;</span> <span class="m">420</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">br</span><span class="o">.</span><span class="nx">webkit3</span> <span class="o">=</span> <span class="nx">br</span><span class="o">.</span><span class="nx">webkit</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">br</span><span class="o">.</span><span class="nx">webkit3</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">br</span><span class="o">;</span>
        <span class="o">}(),</span>
        <span class="c">/** </span>
<span class="c">        * @method init</span>
<span class="c">        * @description The Editor class&#39; initialization method</span>
<span class="c">        */</span>
        <span class="nx">init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;init&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Editor</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)]</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;contentReady&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">DOMReady</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireQueue</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method initAttributes</span>
<span class="c">        * @description Initializes all of the configuration attributes used to create </span>
<span class="c">        * the editor.</span>
<span class="c">        * @param {Object} attr Object literal specifying a set of </span>
<span class="c">        * configuration attributes used to create the editor.</span>
<span class="c">        */</span>
        <span class="nx">initAttributes</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">attr</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Editor</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">initAttributes</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">attr</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

            <span class="c">/**</span>
<span class="c">            * @private</span>
<span class="c">            * @attribute iframe</span>
<span class="c">            * @description Internal config for holding the iframe element.</span>
<span class="c">            * @default null</span>
<span class="c">            * @type HTMLElement</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @private</span>
<span class="c">            * @depreciated</span>
<span class="c">            * @attribute textarea</span>
<span class="c">            * @description Internal config for holding the textarea element (replaced with element).</span>
<span class="c">            * @default null</span>
<span class="c">            * @type HTMLElement</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;textarea&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute nodeChangeThreshold</span>
<span class="c">            * @description The number of seconds that need to be in between nodeChange processing</span>
<span class="c">            * @default 3</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;nodeChangeThreshold&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">nodeChangeThreshold</span> <span class="o">||</span> <span class="m">3</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute element_cont</span>
<span class="c">            * @description Internal config for the editors container</span>
<span class="c">            * @default false</span>
<span class="c">            * @type HTMLElement</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">element_cont</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @private</span>
<span class="c">            * @attribute editor_wrapper</span>
<span class="c">            * @description The outter wrapper for the entire editor.</span>
<span class="c">            * @default null</span>
<span class="c">            * @type HTMLElement</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;editor_wrapper&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">editor_wrapper</span> <span class="o">||</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute height</span>
<span class="c">            * @description The height of the editor iframe container, not including the toolbar..</span>
<span class="c">            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">height</span> <span class="o">||</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">self</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="s1">&#39;height&#39;</span><span class="o">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">height</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_rendered</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//We have been rendered, change the height</span>
<span class="c"></span>                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;animate&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">),</span> <span class="o">{</span>
                                <span class="nx">height</span><span class="o">:</span> <span class="o">{</span>
                                    <span class="nx">to</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">height</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span>
                                <span class="o">}</span>
                            <span class="o">},</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="o">);</span>
                            <span class="nx">anim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">),</span> <span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="nx">height</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute width</span>
<span class="c">            * @description The width of the editor container.</span>
<span class="c">            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">width</span> <span class="o">||</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="s1">&#39;width&#39;</span><span class="o">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">width</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_rendered</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//We have been rendered, change the width</span>
<span class="c"></span>                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;animate&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="o">{</span>
                                <span class="nx">width</span><span class="o">:</span> <span class="o">{</span>
                                    <span class="nx">to</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span>
                                <span class="o">}</span>
                            <span class="o">},</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="o">);</span>
                            <span class="nx">anim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="nx">width</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>
                        
            <span class="c">/**</span>
<span class="c">            * @attribute blankimage</span>
<span class="c">            * @description The CSS used to show/hide hidden elements on the page</span>
<span class="c">            * @default &#39;assets/blankimage.png&#39;</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">blankimage</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getBlankImage</span><span class="o">()</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute hiddencss</span>
<span class="c">            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in &lt;code&gt;this.CLASS_HIDDEN&lt;/code&gt;</span>
<span class="c">            * @default &lt;code&gt;&lt;pre&gt;</span>
<span class="c">            .hidden font, .hidden strong, .hidden b, .hidden em, .hidden i, .hidden u, .hidden div, .hidden p, .hidden span, .hidden img, .hidden ul, .hidden ol, .hidden li, .hidden table {</span>
<span class="c">                border: 1px dotted #ccc;</span>
<span class="c">            }</span>
<span class="c">            .hidden .yui-non {</span>
<span class="c">                border: none;</span>
<span class="c">            }</span>
<span class="c">            .hidden img {</span>
<span class="c">                padding: 2px;</span>
<span class="c">            }&lt;/pre&gt;&lt;/code&gt;</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;hiddencss&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">hiddencss</span> <span class="o">||</span> <span class="s1">&#39;.hidden font, .hidden strong, .hidden b, .hidden em, .hidden i, .hidden u, .hidden div,.hidden p,.hidden span,.hidden img, .hidden ul, .hidden ol, .hidden li, .hidden table { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }&#39;</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute css</span>
<span class="c">            * @description The Base CSS used to format the content of the editor</span>
<span class="c">            * @default &lt;code&gt;&lt;pre&gt;html {</span>
<span class="c">                height: 95%;</span>
<span class="c">            }</span>
<span class="c">            body {</span>
<span class="c">                height: 100%;</span>
<span class="c">                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;</span>
<span class="c">            }</span>
<span class="c">            a {</span>
<span class="c">                color: blue;</span>
<span class="c">                text-decoration: underline;</span>
<span class="c">                cursor: pointer;</span>
<span class="c">            }</span>
<span class="c">            .warning-localfile {</span>
<span class="c">                border-bottom: 1px dashed red !important;</span>
<span class="c">            }</span>
<span class="c">            .yui-busy {</span>
<span class="c">                cursor: wait !important;</span>
<span class="c">            }</span>
<span class="c">            img.selected { //Safari image selection</span>
<span class="c">                border: 2px dotted #808080;</span>
<span class="c">            }</span>
<span class="c">            img {</span>
<span class="c">                cursor: pointer !important;</span>
<span class="c">                border: none;</span>
<span class="c">            }</span>
<span class="c">            &lt;/pre&gt;&lt;/code&gt;</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;css&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">css</span> <span class="o">||</span> <span class="s1">&#39;html { height: 95%; } body { height: 100%; padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a { color: blue; text-decoration: underline; cursor: pointer; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; }&#39;</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute html</span>
<span class="c">            * @description The default HTML to be written to the iframe document before the contents are loaded</span>
<span class="c">            * @default This HTML requires a few things if you are to override:</span>
<span class="c">                &lt;p&gt;&lt;code&gt;{TITLE}, {CSS}, {HIDDEN_CSS}&lt;/code&gt; and &lt;code&gt;{CONTENT}&lt;/code&gt; need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.&lt;p&gt;</span>
<span class="c">                &lt;p&gt;&lt;code&gt;onload=&quot;document.body._rteLoaded = true;&quot;&lt;/code&gt; : the onload statement must be there or the editor will not finish loading.&lt;/p&gt;</span>
<span class="c">                &lt;code&gt;</span>
<span class="c">                &lt;pre&gt;</span>
<span class="c">                &amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;</span>
<span class="c">                &amp;lt;html&amp;gt;</span>
<span class="c">                    &amp;lt;head&amp;gt;</span>
<span class="c">                        &amp;lt;title&amp;gt;{TITLE}&amp;lt;/title&amp;gt;</span>
<span class="c">                        &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&amp;gt;</span>
<span class="c">                        &amp;lt;style&amp;gt;</span>
<span class="c">                        {CSS}</span>
<span class="c">                        &amp;lt;/style&amp;gt;</span>
<span class="c">                        &amp;lt;style&amp;gt;</span>
<span class="c">                        {HIDDEN_CSS}</span>
<span class="c">                        &amp;lt;/style&amp;gt;</span>
<span class="c">                    &amp;lt;/head&amp;gt;</span>
<span class="c">                &amp;lt;body onload=&quot;document.body._rteLoaded = true;&quot;&amp;gt;</span>
<span class="c">                {CONTENT}</span>
<span class="c">                &amp;lt;/body&amp;gt;</span>
<span class="c">                &amp;lt;/html&amp;gt;</span>
<span class="c">                &lt;/pre&gt;</span>
<span class="c">                &lt;/code&gt;</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;html&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">html</span> <span class="o">||</span> <span class="s1">&#39;&lt;!DOCTYPE HTML PUBLIC &quot;-/&#39;</span><span class="o">+</span><span class="s1">&#39;/W3C/&#39;</span><span class="o">+</span><span class="s1">&#39;/DTD HTML 4.01/&#39;</span><span class="o">+</span><span class="s1">&#39;/EN&quot; &quot;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/www.w3.org/TR/html4/strict.dtd&quot;&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;{TITLE}&lt;/title&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;&lt;base href=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_baseHREF</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;style&gt;{CSS}&lt;/style&gt;&lt;style&gt;{HIDDEN_CSS}&lt;/style&gt;&lt;/head&gt;&lt;body onload=&quot;document.body._rteLoaded = true;&quot;&gt;{CONTENT}&lt;/body&gt;&lt;/html&gt;&#39;</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute handleSubmit</span>
<span class="c">            * @description Config handles if the editor will attach itself to the textareas parent form&#39;s submit handler.</span>
<span class="c">            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.</span>
<span class="c">            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;handleSubmit&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">exec</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">exec</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">ta</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">ta</span><span class="o">.</span><span class="nx">form</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">submitForm</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">saveHTML</span><span class="o">();</span>
                                <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">ta</span><span class="o">.</span><span class="nx">form</span><span class="o">,</span> <span class="s1">&#39;submit&#39;</span><span class="o">,</span> <span class="nx">submitForm</span><span class="o">);</span>
                                    <span class="nx">ta</span><span class="o">.</span><span class="nx">form</span><span class="o">.</span><span class="nx">submit</span><span class="o">();</span>
                                <span class="o">},</span> <span class="m">200</span><span class="o">);</span>
                            <span class="o">};</span>
                            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">ta</span><span class="o">.</span><span class="nx">form</span><span class="o">,</span> <span class="s1">&#39;submit&#39;</span><span class="o">,</span> <span class="nx">submitForm</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute disabled</span>
<span class="c">            * @description This will toggle the editor&#39;s disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.</span>
<span class="c">            All Toolbar buttons are also disabled so they cannot be used.</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_setDesignMode</span><span class="o">(</span><span class="s1">&#39;off&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="s1">&#39;100%&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="s1">&#39;100%&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;position&#39;</span><span class="o">,</span> <span class="s1">&#39;absolute&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;top&#39;</span><span class="o">,</span> <span class="s1">&#39;0&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="s1">&#39;0&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;opacity&#39;</span><span class="o">,</span> <span class="s1">&#39;.5&#39;</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">,</span> <span class="s1">&#39;yui-editor-masked&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_setDesignMode</span><span class="o">(</span><span class="s1">&#39;on&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_focusWindow</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute toolbar_cont</span>
<span class="c">            * @description Internal config for the toolbars container</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;toolbar_cont&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute toolbar</span>
<span class="c">            * @description The default toolbar config.</span>
<span class="c">            * @default This config is too large to display here, view the code to see it: &lt;a href=&quot;editor.js.html&quot;&gt;&lt;/a&gt;</span>
<span class="c">            * @type Object</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;toolbar&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">||</span> <span class="o">{</span>
                    <span class="c">/* {{{ Defaut Toolbar Config */</span>
                    <span class="nx">collapse</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                    <span class="nx">titlebar</span><span class="o">:</span> <span class="s1">&#39;Text Editing Tools&#39;</span><span class="o">,</span>
                    <span class="nx">draggable</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                    <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;fontstyle&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Font Name and Size&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;select&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Arial&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;fontname&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                                    <span class="nx">menu</span><span class="o">:</span> <span class="o">[</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Arial&#39;</span><span class="o">,</span> <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Arial Black&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Comic Sans MS&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Courier New&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Lucida Console&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Tahoma&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Times New Roman&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Trebuchet MS&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Verdana&#39;</span> <span class="o">}</span>
                                    <span class="o">]</span>
                                <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;spin&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;13&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;fontsize&#39;</span><span class="o">,</span> <span class="nx">range</span><span class="o">:</span> <span class="o">[</span> <span class="m">9</span><span class="o">,</span> <span class="m">75</span> <span class="o">],</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;textstyle&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Font Style&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Bold CTRL + SHIFT + B&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Italic CTRL + SHIFT + I&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Underline CTRL + SHIFT + U&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;underline&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Subscript&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;subscript&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Superscript&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;superscript&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;color&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Font Color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;forecolor&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;color&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Background Color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;backcolor&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Remove Formatting&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;removeformat&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Show/Hide Hidden Elements&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;hiddenelements&#39;</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;alignment&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Alignment&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Align Left CTRL + SHIFT + [&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;justifyleft&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Align Center CTRL + SHIFT + |&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;justifycenter&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Align Right CTRL + SHIFT + ]&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;justifyright&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Justify&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;justifyfull&#39;</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;parastyle&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Paragraph Style&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                            <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;select&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Normal&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;heading&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                                <span class="nx">menu</span><span class="o">:</span> <span class="o">[</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Normal&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;none&#39;</span><span class="o">,</span> <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 1&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h1&#39;</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 2&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h2&#39;</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 3&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h3&#39;</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 4&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h4&#39;</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 5&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h5&#39;</span> <span class="o">},</span>
                                    <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Header 6&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;h6&#39;</span> <span class="o">}</span>
                                <span class="o">]</span>
                            <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;indentlist&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Indenting and Lists&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Indent&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;indent&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Outdent&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;outdent&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Create an Unordered List&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertunorderedlist&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Create an Ordered List&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertorderedlist&#39;</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;insertitem&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Insert Item&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;HTML Link CTRL + SHIFT + L&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;createlink&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Insert Image&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertimage&#39;</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">}</span>
                    <span class="o">]</span>
                    <span class="c">/* }}} */</span>
                <span class="o">},</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">toolbar</span><span class="o">)</span> <span class="o">{</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute animate</span>
<span class="c">            * @description Should the editor animate window movements</span>
<span class="c">            * @default false unless Animation is found, then true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;animate&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">return</span> <span class="nx">ret</span><span class="o">;</span>
                <span class="o">}</span>               
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute panel</span>
<span class="c">            * @description A reference to the panel we are using for windows.</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">return</span> <span class="nx">ret</span><span class="o">;</span>
                <span class="o">}</span>               
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute localFileWarning</span>
<span class="c">            * @description Should we throw the warning if we detect a file that is local to their machine?</span>
<span class="c">            * @default true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;localFileWarning&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">locaFileWarning</span> <span class="o">||</span> <span class="kc">true</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute focusAtStart</span>
<span class="c">            * @description Should we focus the window when the content is ready?</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;focusAtStart&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">focusAtStart</span> <span class="o">||</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;editorContentLoaded&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                        <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="nx">self</span><span class="o">.</span><span class="nx">_focusWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="o">},</span> <span class="m">400</span><span class="o">);</span>
                    <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute dompath</span>
<span class="c">            * @description Toggle the display of the current Dom path below the editor</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;dompath&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">dompath</span> <span class="o">||</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">dompath</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">dompath</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;_dompath&#39;</span><span class="o">;</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">,</span> <span class="s1">&#39;dompath&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_writeDomPath</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(!</span><span class="nx">dompath</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dompath</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">dompath</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_setupAfterElement</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute markup</span>
<span class="c">            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml</span>
<span class="c">            * @default &quot;semantic&quot;</span>
<span class="c">            * @type String</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;markup&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">markup</span> <span class="o">||</span> <span class="s1">&#39;semantic&#39;</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">markup</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">switch</span> <span class="o">(</span><span class="nx">markup</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                        <span class="nx">case</span> <span class="s1">&#39;semantic&#39;</span><span class="o">:</span>
                        <span class="nx">case</span> <span class="s1">&#39;css&#39;</span><span class="o">:</span>
                        <span class="nx">case</span> <span class="s1">&#39;default&#39;</span><span class="o">:</span>
                        <span class="nx">case</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">:</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute removeLineBreaks</span>
<span class="c">            * @description Should we remove linebreaks and extra spaces on cleanup</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;removeLineBreaks&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">removeLineBreaks</span> <span class="o">||</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isBoolean</span>
            <span class="o">});</span>
            

            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;afterRender&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_renderPanel</span><span class="o">();</span>
            <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _getBlankImage</span>
<span class="c">        * @description Retrieves the full url of the image to use as the blank image.</span>
<span class="c">        * @returns {String} The URL to the blank image</span>
<span class="c">        */</span>
        <span class="nx">_getBlankImage</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">DOMReady</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;_getBlankImage&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">img</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_blankImageLoaded</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">position</span> <span class="o">=</span> <span class="s1">&#39;absolute&#39;</span><span class="o">;</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">;</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">;</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-blankimage&#39;</span><span class="o">;</span>
                <span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">div</span><span class="o">);</span>
                <span class="nx">img</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">div</span><span class="o">,</span> <span class="s1">&#39;background-image&#39;</span><span class="o">);</span>
                <span class="nx">img</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;url(&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;)&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&quot;/g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">,</span> <span class="nx">img</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_blankImageLoaded</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">img</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">img</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleFontSize</span>
<span class="c">        * @description Handles the font size button in the toolbar.</span>
<span class="c">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="c">        */</span>
        <span class="nx">_handleFontSize</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;fontsize&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleColorPicker</span>
<span class="c">        * @description Handles the colorpicker buttons in the toolbar.</span>
<span class="c">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="c">        */</span>
        <span class="nx">_handleColorPicker</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">color</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">cmd</span> <span class="o">==</span> <span class="s1">&#39;forecolor&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">cmd</span> <span class="o">==</span> <span class="s1">&#39;backcolor&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">cmd</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleAlign</span>
<span class="c">        * @description Handles the alignment buttons in the toolbar.</span>
<span class="c">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="c">        */</span>
        <span class="nx">_handleAlign</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">();</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">cmd</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleAfterNodeChange</span>
<span class="c">        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).</span>
<span class="c">        */</span>
        <span class="nx">_handleAfterNodeChange</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDomPath</span><span class="o">(),</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">family</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">fontsize</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">validFont</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">fn_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;fontname&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">fs_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;fontsize&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">hd_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;heading&#39;</span><span class="o">);</span>

            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">path</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

                <span class="k">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="nx">elm</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>


                <span class="k">if</span> <span class="o">(</span><span class="nx">elm</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">tag</span> <span class="o">=</span> <span class="nx">elm</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="nx">family</span> <span class="o">=</span> <span class="nx">elm</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;face&#39;</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;font-family&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">family</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;font-family&#39;</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">tag</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">1</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;h&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">hd_button</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="nx">hd_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">h</span><span class="o">++)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">hd_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">value</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">tag</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">hd_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="nx">hd_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">text</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;heading&#39;</span><span class="o">,</span> <span class="nx">tag</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">fn_button</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">b</span> <span class="o">&lt;</span> <span class="nx">fn_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">b</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">family</span> <span class="o">&amp;&amp;</span> <span class="nx">fn_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">[</span><span class="nx">b</span><span class="o">].</span><span class="nx">text</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">family</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                        <span class="nx">validFont</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">value</span><span class="o">[</span><span class="nx">b</span><span class="o">].</span><span class="nx">text</span><span class="o">;</span> <span class="c">//Put the proper menu name in the button</span>
<span class="c"></span>                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">validFont</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="k">label</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">var</span> <span class="nx">familyLabel</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-fontname-&#39;</span> <span class="o">+</span> <span class="nx">_cleanClassName</span><span class="o">(</span><span class="nx">family</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">family</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">fn_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="nx">familyLabel</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">fn_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="nx">familyLabel</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;fontname&#39;</span><span class="o">,</span> <span class="nx">family</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">fs_button</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">fontsize</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">fontsize</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">||</span> <span class="nb">isNaN</span><span class="o">(</span><span class="nx">fontsize</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">fontsize</span> <span class="o">=</span> <span class="nx">fs_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="k">label</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="nx">fs_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nx">fontsize</span><span class="o">);</span>
            <span class="o">}</span>
            
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">fn_button</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">fs_button</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;forecolor&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;backcolor&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;createlink&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">elm</span><span class="o">,</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;indent&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="s1">&#39;indent&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;outdent&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_lastButton</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            
        <span class="o">},</span>
        <span class="nx">_setBusy</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">off</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">/*</span>
<span class="c">            if (off) {</span>
<span class="c">                Dom.removeClass(document.body, &#39;yui-busy&#39;);</span>
<span class="c">                Dom.removeClass(this._getDoc().body, &#39;yui-busy&#39;);</span>
<span class="c">            } else {</span>
<span class="c">                Dom.addClass(document.body, &#39;yui-busy&#39;);</span>
<span class="c">                Dom.addClass(this._getDoc().body, &#39;yui-busy&#39;);</span>
<span class="c">            }</span>
<span class="c">            */</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleInsertImageClick</span>
<span class="c">        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.</span>
<span class="c">        */</span>
        <span class="nx">_handleInsertImageClick</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setBusy</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
                    <span class="nx">body</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                    <span class="nx">link</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">target</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">title</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">src</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">height</span> <span class="o">=</span> <span class="m">75</span><span class="o">,</span>
                    <span class="nx">width</span> <span class="o">=</span> <span class="m">75</span><span class="o">,</span>
                    <span class="nx">padding</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                    <span class="nx">oheight</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                    <span class="nx">owidth</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                    <span class="nx">blankimage</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
                    <span class="nx">win</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorWindow</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">,</span> <span class="o">{</span>
                        <span class="nx">width</span><span class="o">:</span> <span class="s1">&#39;415px&#39;</span>
                    <span class="o">});</span>

                <span class="k">if</span> <span class="o">(!</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">src</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">src</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">))</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">src</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_HERE</span><span class="o">;</span>
                            <span class="nx">blankimage</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;alt&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">title</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;alt&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">title</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">);</span>
                    <span class="o">}</span>

                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">link</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">target</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="nx">height</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">height</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="nx">width</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">height</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">width</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">margin</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">padding</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">margin</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">el</span><span class="o">.</span><span class="nx">_height</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">_height</span> <span class="o">=</span> <span class="nx">height</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">el</span><span class="o">.</span><span class="nx">_width</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">_width</span> <span class="o">=</span> <span class="nx">width</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">oheight</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">_height</span><span class="o">;</span>
                    <span class="nx">owidth</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">_width</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&lt;label for=&quot;insertimage_url&quot;&gt;&lt;strong&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_URL</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/strong&gt; &lt;input type=&quot;text&quot; id=&quot;insertimage_url&quot; value=&quot;&#39;</span> <span class="o">+</span> <span class="nx">src</span> <span class="o">+</span> <span class="s1">&#39;&quot; size=&quot;40&quot;&gt;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="nx">body</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>

                <span class="k">var</span> <span class="nx">tbarCont</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">tbarCont</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="s1">&#39;img_toolbar&#39;</span><span class="o">;</span>
                <span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">tbarCont</span><span class="o">);</span>

                <span class="k">var</span> <span class="nx">str2</span> <span class="o">=</span> <span class="s1">&#39;&lt;label for=&quot;insertimage_title&quot;&gt;&lt;strong&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_TITLE</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/strong&gt; &lt;input type=&quot;text&quot; id=&quot;insertimage_title&quot; value=&quot;&#39;</span> <span class="o">+</span> <span class="nx">title</span> <span class="o">+</span> <span class="s1">&#39;&quot; size=&quot;40&quot;&gt;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="nx">str2</span> <span class="o">+=</span> <span class="s1">&#39;&lt;label for=&quot;insertimage_link&quot;&gt;&lt;strong&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_URL</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/strong&gt; &lt;input type=&quot;text&quot; name=&quot;insertimage_link&quot; id=&quot;insertimage_link&quot; value=&quot;&#39;</span> <span class="o">+</span> <span class="nx">link</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="nx">str2</span> <span class="o">+=</span> <span class="s1">&#39;&lt;label for=&quot;insertimage_target&quot;&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;input type=&quot;checkbox&quot; name=&quot;insertimage_target_&quot; id=&quot;insertimage_target&quot; value=&quot;_blank&quot;&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">target</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39; checked&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&gt; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_NEW_WINDOW</span> <span class="o">+</span> <span class="s1">&#39;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str2</span><span class="o">;</span>
                <span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">div</span><span class="o">);</span>
                <span class="nx">win</span><span class="o">.</span><span class="nx">cache</span> <span class="o">=</span> <span class="nx">body</span><span class="o">;</span>

                <span class="k">var</span> <span class="nx">tbar</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">(</span><span class="nx">tbarCont</span><span class="o">,</span> <span class="o">{</span>
                    <span class="c">/* {{{ */</span> 
                    <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;textflow&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_TEXTFLOW</span> <span class="o">+</span> <span class="s1">&#39;:&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Left&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;left&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Inline&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;inline&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Block&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;block&#39;</span> <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Right&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;right&#39;</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;padding&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_PADDING</span> <span class="o">+</span> <span class="s1">&#39;:&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;spin&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nx">padding</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;padding&#39;</span><span class="o">,</span> <span class="nx">range</span><span class="o">:</span> <span class="o">[</span><span class="m">0</span><span class="o">,</span> <span class="m">50</span><span class="o">]</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="o">},</span>
                        <span class="o">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;border&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_BORDER</span> <span class="o">+</span> <span class="s1">&#39;:&#39;</span><span class="o">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="o">[</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;select&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Border Size&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;bordersize&#39;</span><span class="o">,</span>
                                    <span class="nx">menu</span><span class="o">:</span> <span class="o">[</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;none&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="o">,</span> <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;1&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;2&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;3&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;4&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;5&#39;</span> <span class="o">}</span>
                                    <span class="o">]</span>
                                <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;select&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Border Type&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;bordertype&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                                    <span class="nx">menu</span><span class="o">:</span> <span class="o">[</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;solid&#39;</span><span class="o">,</span> <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;dashed&#39;</span> <span class="o">},</span>
                                        <span class="o">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;dotted&#39;</span> <span class="o">}</span>
                                    <span class="o">]</span>
                                <span class="o">},</span>
                                <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;color&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;Border Color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;bordercolor&#39;</span><span class="o">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="o">}</span>
                            <span class="o">]</span>
                        <span class="o">}</span>
                    <span class="o">]</span>
                    <span class="c">/* }}} */</span>
                <span class="o">});</span>
                
                <span class="k">var</span> <span class="nx">bsize</span> <span class="o">=</span> <span class="s1">&#39;0&#39;</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">btype</span> <span class="o">=</span> <span class="s1">&#39;solid&#39;</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">bsize</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">btype</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">var</span> <span class="nx">bs_button</span> <span class="o">=</span> <span class="nx">tbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;bordersize&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">bSizeStr</span> <span class="o">=</span> <span class="o">((</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">bsize</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;&#39;</span> <span class="o">:</span> <span class="s1">&#39;none&#39;</span><span class="o">);</span>
                <span class="nx">bs_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-bordersize-&#39;</span> <span class="o">+</span> <span class="nx">bsize</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">+</span><span class="nx">bSizeStr</span><span class="o">+</span><span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;bordersize&#39;</span><span class="o">,</span> <span class="nx">bsize</span><span class="o">,</span> <span class="nx">tbar</span><span class="o">);</span>

                <span class="k">var</span> <span class="nx">bt_button</span> <span class="o">=</span> <span class="nx">tbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;bordertype&#39;</span><span class="o">);</span>
                <span class="nx">bt_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-bordertype-&#39;</span> <span class="o">+</span> <span class="nx">btype</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;/span&gt;&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_updateMenuChecked</span><span class="o">(</span><span class="s1">&#39;bordertype&#39;</span><span class="o">,</span> <span class="nx">btype</span><span class="o">,</span> <span class="nx">tbar</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">bsize</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">bt_button</span><span class="o">);</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">bs_button</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="k">var</span> <span class="nx">cont</span> <span class="o">=</span> <span class="nx">tbar</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">hw</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">hw</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-toolbar-group yui-toolbar-group-height-width height-width&#39;</span><span class="o">;</span>
                <span class="nx">hw</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;h3&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_SIZE</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/h3&gt;&#39;</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">orgSize</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">height</span> <span class="o">!=</span> <span class="nx">oheight</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">width</span> <span class="o">!=</span> <span class="nx">owidth</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">orgSize</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;info&quot;&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_ORIG_SIZE</span> <span class="o">+</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="o">+</span> <span class="nx">owidth</span> <span class="o">+</span><span class="s1">&#39; x &#39;</span> <span class="o">+</span> <span class="nx">oheight</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="nx">hw</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">+=</span> <span class="s1">&#39;&lt;span&gt;&lt;input type=&quot;text&quot; size=&quot;3&quot; value=&quot;&#39;</span><span class="o">+</span><span class="nx">width</span><span class="o">+</span><span class="s1">&#39;&quot; id=&quot;insertimage_width&quot;&gt; x &lt;input type=&quot;text&quot; size=&quot;3&quot; value=&quot;&#39;</span><span class="o">+</span><span class="nx">height</span><span class="o">+</span><span class="s1">&#39;&quot; id=&quot;insertimage_height&quot;&gt;&lt;/span&gt;&#39;</span> <span class="o">+</span> <span class="nx">orgSize</span><span class="o">;</span>
                <span class="nx">cont</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">hw</span><span class="o">,</span> <span class="nx">cont</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">);</span>

                <span class="nx">Event</span><span class="o">.</span><span class="nx">onAvailable</span><span class="o">(</span><span class="s1">&#39;insertimage_width&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;insertimage_width&#39;</span><span class="o">,</span> <span class="s1">&#39;blur&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_width&#39;</span><span class="o">).</span><span class="nx">value</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">value</span> <span class="o">&gt;</span> <span class="m">5</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">onAvailable</span><span class="o">(</span><span class="s1">&#39;insertimage_height&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;insertimage_height&#39;</span><span class="o">,</span> <span class="s1">&#39;blur&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_height&#39;</span><span class="o">).</span><span class="nx">value</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">value</span> <span class="o">&gt;</span> <span class="m">5</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

                <span class="k">if</span> <span class="o">((</span><span class="nx">el</span><span class="o">.</span><span class="nx">align</span> <span class="o">==</span> <span class="s1">&#39;right&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">align</span> <span class="o">==</span> <span class="s1">&#39;left&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">align</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">==</span> <span class="s1">&#39;block&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;block&#39;</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;inline&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">marginLeft</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                     <span class="nx">tbar</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="s1">&#39;padding&#39;</span><span class="o">).</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">marginLeft</span><span class="o">,</span> <span class="m">10</span><span class="o">));</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderSize</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;bordersize&#39;</span><span class="o">);</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderSize</span><span class="o">,</span> <span class="m">10</span><span class="o">));</span>
                <span class="o">}</span>

                <span class="nx">tbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;colorPickerClicked&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">size</span> <span class="o">=</span> <span class="s1">&#39;1&#39;</span><span class="o">,</span> <span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;solid&#39;</span><span class="o">,</span> <span class="nx">color</span> <span class="o">=</span> <span class="s1">&#39;black&#39;</span><span class="o">;</span>

                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">size</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">type</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftColor</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">color</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftColor</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">borderString</span> <span class="o">=</span> <span class="nx">size</span> <span class="o">+</span> <span class="s1">&#39;px &#39;</span> <span class="o">+</span> <span class="nx">type</span> <span class="o">+</span> <span class="s1">&#39; #&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">color</span><span class="o">;</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">border</span> <span class="o">=</span> <span class="nx">borderString</span><span class="o">;</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

                <span class="nx">tbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;buttonClick&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span>
                        <span class="nx">borderString</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">value</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">size</span> <span class="o">=</span> <span class="s1">&#39;1&#39;</span><span class="o">,</span> <span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;solid&#39;</span><span class="o">,</span> <span class="nx">color</span> <span class="o">=</span> <span class="s1">&#39;black&#39;</span><span class="o">;</span>

                    <span class="c">/* All border calcs are done on the left border</span>
<span class="c">                        since our default interface only supports</span>
<span class="c">                        one border size/type and color */</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">size</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">type</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftStyle</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftColor</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">color</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">borderLeftColor</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">switch</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">case</span> <span class="s1">&#39;bordersize&#39;</span><span class="o">:</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">,</span> <span class="s1">&#39;selected&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="o">}</span>

                            <span class="nx">borderString</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px &#39;</span> <span class="o">+</span> <span class="nx">type</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="nx">color</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">border</span> <span class="o">=</span> <span class="nx">borderString</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">tbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;bordertype&#39;</span><span class="o">);</span>
                                <span class="nx">tbar</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="s1">&#39;bordercolor&#39;</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">tbar</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="s1">&#39;bordertype&#39;</span><span class="o">);</span>
                                <span class="nx">tbar</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="s1">&#39;bordercolor&#39;</span><span class="o">);</span>
                            <span class="o">}</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;bordertype&#39;</span><span class="o">:</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span><span class="o">,</span> <span class="s1">&#39;selected&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="nx">borderString</span> <span class="o">=</span> <span class="nx">size</span> <span class="o">+</span> <span class="s1">&#39;px &#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="nx">color</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">border</span> <span class="o">=</span> <span class="nx">borderString</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;right&#39;</span><span class="o">:</span>
                        <span class="nx">case</span> <span class="s1">&#39;left&#39;</span><span class="o">:</span>
                            <span class="nx">tbar</span><span class="o">.</span><span class="nx">deselectAllButtons</span><span class="o">();</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">align</span> <span class="o">=</span> <span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;inline&#39;</span><span class="o">:</span>
                            <span class="nx">tbar</span><span class="o">.</span><span class="nx">deselectAllButtons</span><span class="o">();</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;block&#39;</span><span class="o">:</span>
                            <span class="nx">tbar</span><span class="o">.</span><span class="nx">deselectAllButtons</span><span class="o">();</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;block&#39;</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;center&#39;</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;padding&#39;</span><span class="o">:</span>
                            <span class="k">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="nx">tbar</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">margin</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">tbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">button</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

                <span class="nx">win</span><span class="o">.</span><span class="nx">setHeader</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_PROP_TITLE</span><span class="o">);</span>
                <span class="nx">win</span><span class="o">.</span><span class="nx">setBody</span><span class="o">(</span><span class="nx">body</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">win</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_COPY</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">openWindow</span><span class="o">(</span><span class="nx">win</span><span class="o">);</span>

                <span class="c">//Set event after openWindow..</span>
<span class="c"></span>                <span class="nx">Event</span><span class="o">.</span><span class="nx">onAvailable</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">);</span>

                    <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">).</span><span class="nx">focus</span><span class="o">();</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">blankimage</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">).</span><span class="nx">select</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">},</span> <span class="m">50</span><span class="o">);</span>
                    
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;localFileWarning&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;insertimage_link&#39;</span><span class="o">,</span> <span class="s1">&#39;blur&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_link&#39;</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">))</span> <span class="o">{</span>
                                <span class="c">//Local File throw Warning</span>
<span class="c"></span>                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Local file reference found, show local warning&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_LOCAL_FILE_WARNING</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
                                <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_COPY</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

                        <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">,</span> <span class="s1">&#39;blur&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">))</span> <span class="o">{</span>
                                <span class="c">//Local File throw Warning</span>
<span class="c"></span>                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Local file reference found, show local warning&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_LOCAL_FILE_WARNING</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
                                <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_COPY</span><span class="o">);</span>
                                <span class="o">}</span>
                                
                                <span class="k">if</span> <span class="o">(</span><span class="nx">url</span> <span class="o">&amp;&amp;</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_HERE</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                                    <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
                                        <span class="nx">img</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Image</span><span class="o">();</span>

                                    <span class="nx">img</span><span class="o">.</span><span class="nx">onerror</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                                        <span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">self</span><span class="o">.</span><span class="nx">STR_IMAGE_HERE</span><span class="o">;</span>
                                        <span class="nx">img</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">self</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">));</span>
                                        <span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">self</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">));</span>
                                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_height&#39;</span><span class="o">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">height</span><span class="o">;</span>
                                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_width&#39;</span><span class="o">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>
                                    <span class="o">};</span>
                                    <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_height&#39;</span><span class="o">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">height</span><span class="o">;</span>
                                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_width&#39;</span><span class="o">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>
                                        <span class="k">if</span> <span class="o">(</span><span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span> <span class="o">&amp;&amp;</span> <span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                                            <span class="k">if</span> <span class="o">(!</span><span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">_height</span><span class="o">)</span> <span class="o">{</span>
                                                <span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">_height</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">height</span><span class="o">;</span>
                                            <span class="o">}</span>
                                            <span class="k">if</span> <span class="o">(!</span><span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">_width</span><span class="o">)</span> <span class="o">{</span>
                                                <span class="nx">self</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">_width</span> <span class="o">=</span> <span class="nx">img</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>
                                            <span class="o">}</span>
                                        <span class="o">}</span>
                                        <span class="nx">self</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                                    <span class="o">},</span> <span class="m">200</span><span class="o">);</span>

                                    <span class="k">if</span> <span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_HERE</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="nx">img</span><span class="o">.</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleInsertImageWindowClose</span>
<span class="c">        * @description Handles the closing of the Image Properties Window.</span>
<span class="c">        */</span>
        <span class="nx">_handleInsertImageWindowClose</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_url&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">title</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_title&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">link</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_link&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;insertimage_target&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">url</span> <span class="o">&amp;&amp;</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_IMAGE_HERE</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="nx">title</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;alt&#39;</span><span class="o">,</span> <span class="nx">title</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">par</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">link</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">urlValue</span> <span class="o">=</span> <span class="nx">link</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">)</span> <span class="o">!=</span> <span class="s1">&#39;/&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">6</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">((</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;@&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">6</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="c">//Found an @ sign, prefix with mailto:</span>
<span class="c"></span>                            <span class="nx">urlValue</span> <span class="o">=</span> <span class="s1">&#39;mailto:&#39;</span> <span class="o">+</span> <span class="nx">urlValue</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="c">/* :// not found adding */</span>
                            <span class="nx">urlValue</span> <span class="o">=</span> <span class="s1">&#39;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">urlValue</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">par</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">par</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">par</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="nx">urlValue</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">checked</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">par</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">par</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">_a</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
                        <span class="nx">_a</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="nx">urlValue</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">checked</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">_a</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">_a</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_a</span><span class="o">,</span> <span class="nx">el</span><span class="o">);</span>
                        <span class="nx">_a</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">par</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">par</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">par</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">par</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="c">//No url/src given, remove the node from the document</span>
<span class="c"></span>                <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _isLocalFile</span>
<span class="c">        * @param {String} url THe url/string to check</span>
<span class="c">        * @description Checks to see if a string (href or img src) is possibly a local file reference..</span>
<span class="c">        */</span>
        <span class="nx">_isLocalFile</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">url</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">url</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">url</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;file:/&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;:\\&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleCreateLinkClick</span>
<span class="c">        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.</span>
<span class="c">        */</span>
        <span class="nx">_handleCreateLinkClick</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;insertimageClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;insertimageClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">});</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

                <span class="k">var</span> <span class="nx">win</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorWindow</span><span class="o">(</span><span class="s1">&#39;createlink&#39;</span><span class="o">,</span> <span class="o">{</span>
                    <span class="nx">width</span><span class="o">:</span> <span class="s1">&#39;350px&#39;</span>
                <span class="o">});</span>
                
                <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">title</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">target</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                    <span class="nx">localFile</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">url</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">))</span> <span class="o">{</span>
                            <span class="c">//Local File throw Warning</span>
<span class="c"></span>                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Local file reference found, show local warning&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="nx">win</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_LOCAL_FILE_WARNING</span><span class="o">);</span>
                            <span class="nx">localFile</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">win</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">title</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">target</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&lt;label for=&quot;createlink_url&quot;&gt;&lt;strong&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_URL</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/strong&gt; &lt;input type=&quot;text&quot; name=&quot;createlink_url&quot; id=&quot;createlink_url&quot; value=&quot;&#39;</span> <span class="o">+</span> <span class="nx">url</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">localFile</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39; class=&quot;warning&quot;&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&gt;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="nx">str</span> <span class="o">+=</span> <span class="s1">&#39;&lt;label for=&quot;createlink_target&quot;&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;input type=&quot;checkbox&quot; name=&quot;createlink_target_&quot; id=&quot;createlink_target&quot; value=&quot;_blank&quot;&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">target</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39; checked&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&gt; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_NEW_WINDOW</span> <span class="o">+</span> <span class="s1">&#39;&lt;/label&gt;&#39;</span><span class="o">;</span>
                <span class="nx">str</span> <span class="o">+=</span> <span class="s1">&#39;&lt;label for=&quot;createlink_title&quot;&gt;&lt;strong&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_TITLE</span> <span class="o">+</span> <span class="s1">&#39;:&lt;/strong&gt; &lt;input type=&quot;text&quot; name=&quot;createlink_title&quot; id=&quot;createlink_title&quot; value=&quot;&#39;</span> <span class="o">+</span> <span class="nx">title</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;/label&gt;&#39;</span><span class="o">;</span>
                
                <span class="k">var</span> <span class="nx">body</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>

                <span class="k">var</span> <span class="nx">unlinkCont</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">unlinkCont</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;removeLink&#39;</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">unlink</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
                <span class="nx">unlink</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span><span class="o">;</span>
                <span class="nx">unlink</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_PROP_REMOVE</span><span class="o">;</span>
                <span class="nx">unlink</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_PROP_REMOVE</span><span class="o">;</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">unlink</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;unlink&#39;</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="nx">unlinkCont</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">unlink</span><span class="o">);</span>
                <span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">unlinkCont</span><span class="o">);</span>

                <span class="nx">win</span><span class="o">.</span><span class="nx">setHeader</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_LINK_PROP_TITLE</span><span class="o">);</span>
                <span class="nx">win</span><span class="o">.</span><span class="nx">setBody</span><span class="o">(</span><span class="nx">body</span><span class="o">);</span>

                <span class="nx">Event</span><span class="o">.</span><span class="nx">onAvailable</span><span class="o">(</span><span class="s1">&#39;createlink_url&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">try</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;createlink_url&#39;</span><span class="o">).</span><span class="nx">focus</span><span class="o">();</span>
                        <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{}</span>
                    <span class="o">},</span> <span class="m">50</span><span class="o">);</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;createlink_url&#39;</span><span class="o">,</span> <span class="s1">&#39;blur&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;createlink_url&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isLocalFile</span><span class="o">(</span><span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">))</span> <span class="o">{</span>
                            <span class="c">//Local File throw Warning</span>
<span class="c"></span>                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Local file reference found, show local warning&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_LOCAL_FILE_WARNING</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">url</span><span class="o">,</span> <span class="s1">&#39;warning&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">openWindow</span><span class="o">(</span><span class="nx">win</span><span class="o">);</span>
            <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleCreateLinkWindowClose</span>
<span class="c">        * @description Handles the closing of the Link Properties Window.</span>
<span class="c">        */</span>
        <span class="nx">_handleCreateLinkWindowClose</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;createlink_url&#39;</span><span class="o">),</span>
                <span class="nx">target</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;createlink_target&#39;</span><span class="o">),</span>
                <span class="nx">title</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;createlink_title&#39;</span><span class="o">),</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
                <span class="nx">a</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">url</span> <span class="o">&amp;&amp;</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">urlValue</span> <span class="o">=</span> <span class="nx">url</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">)</span> <span class="o">!=</span> <span class="s1">&#39;/&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">6</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;@&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">urlValue</span><span class="o">.</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">6</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="c">//Found an @ sign, prefix with mailto:</span>
<span class="c"></span>                        <span class="nx">urlValue</span> <span class="o">=</span> <span class="s1">&#39;mailto:&#39;</span> <span class="o">+</span> <span class="nx">urlValue</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="c">/* :// not found adding */</span>
                        <span class="nx">urlValue</span> <span class="o">=</span> <span class="s1">&#39;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">urlValue</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;href&#39;</span><span class="o">,</span> <span class="nx">urlValue</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">checked</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">.</span><span class="nx">value</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;target&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="o">((</span><span class="nx">title</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">?</span> <span class="nx">title</span><span class="o">.</span><span class="nx">value</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">));</span>

            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                <span class="nx">_span</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="nx">el</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method render</span>
<span class="c">        * @description Causes the toolbar and the editor to render and replace the textarea.</span>
<span class="c">        */</span>
        <span class="nx">render</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_rendered</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Render&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">DOMReady</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;render&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setBusy</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_rendered</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;textarea&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;display&#39;</span><span class="o">,</span> <span class="s1">&#39;none&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_CONTAINER</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_createIframe</span><span class="o">());</span>
            <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">_setInitialContent</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
            <span class="o">},</span> <span class="m">10</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;editor_wrapper&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">),</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_EDITABLE_CONT</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_EDITABLE</span><span class="o">);</span>


            <span class="k">var</span> <span class="nx">tbarConf</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;toolbar&#39;</span><span class="o">);</span>
            <span class="c">//Set the toolbar to disabled until content is loaded</span>
<span class="c"></span>            <span class="nx">tbarConf</span><span class="o">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="c">//Create Toolbar instance</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Toolbar</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;toolbar_cont&#39;</span><span class="o">),</span> <span class="nx">tbarConf</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;fireEvent::toolbarLoaded&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;toolbarLoaded&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;toolbarLoaded&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span> <span class="o">});</span>

            
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;toolbarCollapsed&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;toolbarExpanded&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;fontsizeClick&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleFontSize</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;colorPickerClicked&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleColorPicker</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;alignClick&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleAlign</span><span class="o">(</span><span class="nx">o</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleAfterNodeChange</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;insertimageClick&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleInsertImageClick</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;windowinsertimageClose&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleInsertImageWindowClose</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleCreateLinkClick</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;windowcreatelinkClose&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_handleCreateLinkWindowClose</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>


            <span class="c">//Replace Textarea with editable area</span>
<span class="c"></span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">).</span><span class="nx">replaceChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>


            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h2&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-editor-skipheader&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span><span class="o">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="s1">&#39;-1&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_BEFORE_EDITOR</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">).</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">beforeElement</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;nextSibling&#39;</span><span class="o">));</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;visibility&#39;</span><span class="o">,</span> <span class="s1">&#39;hidden&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;position&#39;</span><span class="o">,</span> <span class="s1">&#39;absolute&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;top&#39;</span><span class="o">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;display&#39;</span><span class="o">,</span> <span class="s1">&#39;block&#39;</span><span class="o">);</span>


            <span class="c">//Set height and width of editor container</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">));</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">),</span> <span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;height&#39;</span><span class="o">));</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="s1">&#39;100%&#39;</span><span class="o">);</span> <span class="c">//WIDTH</span>
<span class="c"></span>            <span class="c">//this.get(&#39;iframe&#39;).setStyle(&#39;_width&#39;, &#39;99%&#39;); //WIDTH</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="s1">&#39;100%&#39;</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterRender&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterRender&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method execCommand</span>
<span class="c">        * @param {String} action The &quot;execCommand&quot; action to try to execute (Example: bold, insertimage, inserthtml)</span>
<span class="c">        * @param {String} value (optional) The value for a given action such as action: fontname value: &#39;Verdana&#39;</span>
<span class="c">        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions</span>
<span class="c">        */</span>
        <span class="nx">execCommand</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">action</span><span class="o">,</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">beforeExec</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;beforeExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">args</span><span class="o">:</span> <span class="nx">arguments</span> <span class="o">});</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">beforeExec</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setMarkupType</span><span class="o">(</span><span class="nx">action</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getWindow</span><span class="o">().</span><span class="nx">focus</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">selEl</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">tag</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                <span class="nx">_span</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">(),</span>
                <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">(),</span>
                <span class="nx">_selEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">_selEl</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_sel</span> <span class="o">=</span> <span class="nx">_selEl</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="nx">switch</span> <span class="o">(</span><span class="nx">action</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="s1">&#39;heading&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;formatblock&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">value</span> <span class="o">==</span> <span class="s1">&#39;none&#39;</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">((</span><span class="nx">_sel</span> <span class="o">&amp;&amp;</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">_sel</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;h&#39;</span><span class="o">))</span> <span class="o">||</span> <span class="o">(</span><span class="nx">_sel</span> <span class="o">&amp;&amp;</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">&amp;&amp;</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;h&#39;</span><span class="o">)))</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;h&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;html&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="nx">_sel</span> <span class="o">=</span> <span class="nx">_sel</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_sel</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Could not find header element&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="k">for</span> <span class="o">(</span><span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">h</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h1&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h2&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h3&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h4&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h5&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;h6&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">],</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="nx">el</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">;</span>
                                        <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="o">(</span><span class="s1">&#39;&lt;span class=&quot;yui-non&quot;&gt;(.*?)&lt;\/span&gt;&#39;</span><span class="o">,</span> <span class="s1">&#39;gi&#39;</span><span class="o">),</span> <span class="s1">&#39;$1&#39;</span><span class="o">);</span>
                                    <span class="o">});</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                                <span class="o">}</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">,</span> <span class="s1">&#39;br&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="k">var</span> <span class="nx">_br</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;br&#39;</span><span class="o">);</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">_br</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h1&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h2&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h3&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h4&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h5&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="s1">&#39;h6&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="nx">value</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                            <span class="c">//If the next sibling is a br, remove it</span>
<span class="c"></span>                            <span class="k">for</span> <span class="o">(</span><span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">h</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">,</span> <span class="s1">&#39;br&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">h</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;backcolor&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;hilitecolor&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="c">/**</span>
<span class="c">                    * @browser opera</span>
<span class="c">                    * @knownissue - Opera fails to assign a background color on an element that already has one.</span>
<span class="c">                    */</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;background-color&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;background-color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">backgroundColor</span><span class="o">:</span> <span class="nx">value</span> <span class="o">});</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">el</span> <span class="o">!==</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;background-color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;forecolor&#39;</span><span class="o">:</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">el</span> <span class="o">!==</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">()))</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;color&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;hiddenelements&#39;</span><span class="o">:</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_showHidden</span><span class="o">();</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;unlink&#39;</span><span class="o">:</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">;</span>
                    <span class="o">});</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;createlink&#39;</span><span class="o">:</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                    <span class="k">var</span> <span class="nx">_a</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;a&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
                        <span class="nx">_a</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;a&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_a</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;insertimage&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">value</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="c">                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="c">                    */</span>
                    
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;InsertImage: &#39;</span> <span class="o">+</span> <span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">queryCommandEnabled</span><span class="o">(</span><span class="nx">action</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                            <span class="k">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">imgs</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;yui-img&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;yui-img&#39;</span><span class="o">);</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">imgs</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">_img</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">el</span> <span class="o">==</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_img</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                                <span class="nx">_img</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_img</span><span class="o">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_img</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                                <span class="nx">_img</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                                <span class="nx">_img</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_img</span><span class="o">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_img</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                            <span class="o">}</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_img</span><span class="o">;</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;inserthtml&#39;</span><span class="o">:</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="c">                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="c">                    */</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">queryCommandEnabled</span><span class="o">(</span><span class="nx">action</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;More Safari DOM tricks (inserthtml)&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;EditorSafari&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                        <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                        <span class="nx">_span</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">value</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">();</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">_range</span><span class="o">.</span><span class="nx">item</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">_range</span><span class="o">.</span><span class="nx">item</span><span class="o">(</span><span class="m">0</span><span class="o">).</span><span class="nx">outerHTML</span> <span class="o">=</span> <span class="nx">value</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">_range</span><span class="o">.</span><span class="nx">pasteHTML</span><span class="o">(</span><span class="nx">value</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>                    
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;removeformat&#39;</span><span class="o">:</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue Remove Format issue</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.</span>
<span class="c">                    * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.</span>
<span class="c">                    * So here we are making the best possible guess and acting on it.</span>
<span class="c">                    */</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">queryCommandEnabled</span><span class="o">(</span><span class="nx">action</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                        <span class="k">var</span> <span class="nx">re</span><span class="o">=</span> <span class="sr">/&lt;\S[^&gt;&lt;]*&gt;/g</span><span class="o">;</span>
                        <span class="nx">str</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">innerHTML</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="nx">re</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                        <span class="k">var</span> <span class="nx">_txt</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createTextNode</span><span class="o">(</span><span class="nx">str</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_txt</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">);</span>
                        
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;superscript&#39;</span><span class="o">:</span>
                <span class="nx">case</span> <span class="s1">&#39;subscript&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Safari dom fun again (&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;)..&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;EditorSafari&#39;</span><span class="o">);</span>
                        <span class="nx">tag</span> <span class="o">=</span> <span class="nx">action</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">substring</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">3</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_selEl</span><span class="o">,</span> <span class="nx">tag</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;we are a child of tag (&#39;</span> <span class="o">+</span> <span class="nx">tag</span> <span class="o">+</span> <span class="s1">&#39;), reverse process&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;EditorSafari&#39;</span><span class="o">);</span>
                            <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">el</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">;</span>
                            <span class="o">});</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">_span</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="nx">tag</span><span class="o">);</span>
                            <span class="k">var</span> <span class="nx">_sub</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_swapEl</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">tag</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">_sub</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_sub</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;formatblock&#39;</span><span class="o">:</span>
                    <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;blockquote&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-tag-blockquote&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                            <span class="nx">_span</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">innerHTML</span><span class="o">;</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">tar</span><span class="o">,</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                            <span class="nx">_span</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                            <span class="nx">tar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="nx">tar</span><span class="o">);</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;indent&#39;</span><span class="o">:</span>
                <span class="nx">case</span> <span class="s1">&#39;outdent&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">gecko</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">selEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                        <span class="k">var</span> <span class="nx">_bq</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">selEl</span><span class="o">,</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">action</span> <span class="o">==</span> <span class="s1">&#39;indent&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_bq</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;blockquote&#39;</span><span class="o">);</span>
                                <span class="nx">_bq</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                                <span class="nx">selEl</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                                <span class="nx">selEl</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_bq</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">_bq</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">var</span> <span class="nx">par</span> <span class="o">=</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">selEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">))</span> <span class="o">{</span>
                                    <span class="nx">par</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">par</span><span class="o">);</span>
                                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                    <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                                    <span class="nx">_span</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                                    <span class="nx">par</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_span</span><span class="o">,</span> <span class="nx">selEl</span><span class="o">);</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">_span</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">action</span> <span class="o">==</span> <span class="s1">&#39;indent&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;blockquote&#39;</span><span class="o">);</span>
                                <span class="nx">_bq</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;blockquote&#39;</span><span class="o">);</span>
                                <span class="nx">_bq</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">innerHTML</span><span class="o">;</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_bq</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_bq</span><span class="o">;</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_selectNode</span><span class="o">(</span><span class="nx">_bq</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Can not outdent, we are not inside a blockquote&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="c">//action = &#39;formatblock&#39;;</span>
<span class="c"></span>                        <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;blockquote&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;insertorderedlist&#39;</span><span class="o">:</span>
                <span class="nx">case</span> <span class="s1">&#39;insertunorderedlist&#39;</span><span class="o">:</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue Safari 2.+ doesn&#39;t support ordered and unordered lists</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * The issue with this workaround is that when applied to a set of text</span>
<span class="c">                    * that has BR&#39;s in it, Safari may or may not pick up the individual items as</span>
<span class="c">                    * list items. This is fixed in WebKit (Safari 3)</span>
<span class="c">                    */</span>
                    <span class="nx">tag</span> <span class="o">=</span> <span class="o">((</span><span class="nx">action</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;insertorderedlist&#39;</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;ol&#39;</span> <span class="o">:</span> <span class="s1">&#39;ul&#39;</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">queryCommandEnabled</span><span class="o">(</span><span class="nx">action</span><span class="o">)))</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">list</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                        <span class="nx">selEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                        <span class="k">var</span> <span class="nx">li</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">selEl</span><span class="o">,</span> <span class="s1">&#39;li&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">selEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="nx">tag</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;We already have a list, undo it&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
                            <span class="nx">list</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">list</span><span class="o">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="o">);</span>
                            <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="k">var</span> <span class="nx">lis</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
                            <span class="k">for</span> <span class="o">(</span><span class="nx">li</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">li</span> <span class="o">&lt;</span> <span class="nx">lis</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">li</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="nx">str</span> <span class="o">+=</span> <span class="s1">&#39;&lt;div&gt;&#39;</span> <span class="o">+</span> <span class="nx">lis</span><span class="o">[</span><span class="nx">li</span><span class="o">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&lt;/div&gt;&#39;</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="nx">list</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Create list item&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="nx">tag</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">());</span>
                            <span class="nx">list</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="nx">tag</span><span class="o">);</span>
                            <span class="k">var</span> <span class="nx">els</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">;</span>
                            <span class="k">for</span> <span class="o">(</span><span class="nx">li</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">li</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">li</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">var</span> <span class="nx">newli</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
                                <span class="nx">newli</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">li</span><span class="o">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="o">;</span>
                                <span class="nx">list</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">newli</span><span class="o">);</span>
                                <span class="k">if</span> <span class="o">(</span><span class="nx">li</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">li</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">li</span><span class="o">]);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">list</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;li&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="nx">tag</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">().</span><span class="nx">parentElement</span><span class="o">,</span> <span class="s1">&#39;li&#39;</span><span class="o">)))</span> <span class="o">{</span> <span class="c">//we are in a list..</span>
<span class="c"></span>                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;We already have a list, undo it&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Undo IE&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                                <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                                <span class="k">var</span> <span class="nx">lis2</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
                                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">lis2</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                                    <span class="nx">str</span> <span class="o">+=</span> <span class="nx">lis2</span><span class="o">[</span><span class="nx">j</span><span class="o">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="o">;</span>
                                <span class="o">}</span>
                                <span class="k">var</span> <span class="nx">newEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                                <span class="nx">newEl</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
                                <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">newEl</span><span class="o">,</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">action</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">,</span> <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
                            <span class="o">}</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                            <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                                <span class="k">var</span> <span class="nx">liso</span> <span class="o">=</span> <span class="nx">self</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
                                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">liso</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                                    <span class="k">if</span> <span class="o">(</span><span class="nx">liso</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">innerHTML</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="nx">liso</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">liso</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">);</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                            <span class="o">},</span><span class="m">30</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="nx">exec</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">().</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&lt;li&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">().</span><span class="nx">html</span><span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="o">;</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&lt;li&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">().</span><span class="nx">text</span> <span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="o">;</span>
                            <span class="o">}</span>

                            <span class="k">this</span><span class="o">.</span><span class="nx">_getRange</span><span class="o">().</span><span class="nx">pasteHTML</span><span class="o">(</span><span class="s1">&#39;&lt;&#39;</span> <span class="o">+</span> <span class="nx">tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span> <span class="o">+</span> <span class="nx">html</span> <span class="o">+</span> <span class="s1">&#39;&lt;/&#39;</span> <span class="o">+</span> <span class="nx">tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span><span class="o">);</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;fontname&#39;</span><span class="o">:</span>
                    <span class="nx">selEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">();</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">currentFont</span> <span class="o">=</span> <span class="nx">value</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">selEl</span> <span class="o">&amp;&amp;</span> <span class="nx">selEl</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">selEl</span><span class="o">,</span> <span class="s1">&#39;font-family&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                        <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;fontsize&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">()))</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">(),</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">(),</span> <span class="s1">&#39;fontSize&#39;</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_createCurrentElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="o">{</span><span class="s1">&#39;fontSize&#39;</span><span class="o">:</span> <span class="nx">value</span> <span class="o">});</span>
                    <span class="o">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">exec</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;), (&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="k">try</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="nx">action</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="nx">value</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">catch</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;execCommand Failed&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;OVERRIDE::execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;),(&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;) skipped&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
            <span class="o">});</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _swapEl</span>
<span class="c">        * @param {HTMLElement} el The element to swap with</span>
<span class="c">        * @param {String} tagName The tagname of the element that you wish to create</span>
<span class="c">        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.</span>
<span class="c">        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it&#39;s place.</span>
<span class="c">        */</span>
        <span class="nx">_swapEl</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">tagName</span><span class="o">,</span> <span class="nx">callback</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">_el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">createElement</span><span class="o">(</span><span class="nx">tagName</span><span class="o">);</span>
            <span class="nx">_el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">callback</span> <span class="o">==</span> <span class="s1">&#39;function&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">callback</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">_el</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="nx">el</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">_el</span><span class="o">,</span> <span class="nx">el</span><span class="o">);</span>
            <span class="k">return</span> <span class="nx">_el</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _createCurrentElement</span>
<span class="c">        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create</span>
<span class="c">        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.</span>
<span class="c">        * @description This is a work around for the various browser issues with execCommand. This method will run &lt;code&gt;execCommand(&#39;fontname&#39;, false, &#39;yui-tmp&#39;)&lt;/code&gt; on the given selection.</span>
<span class="c">        * It will then search the document for an element with the font-family set to &lt;strong&gt;yui-tmp&lt;/strong&gt; and replace that with another span that has other information in it, then assign the new span to the </span>
<span class="c">        * &lt;code&gt;this.currentElement&lt;/code&gt; array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.</span>
<span class="c">        */</span>
        <span class="nx">_createCurrentElement</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">tagName</span><span class="o">,</span> <span class="nx">tagStyle</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">tagName</span> <span class="o">=</span> <span class="o">((</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">?</span> <span class="nx">tagName</span> <span class="o">:</span> <span class="s1">&#39;a&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">(),</span>
                <span class="nx">tar</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="o">[],</span>
                <span class="nx">_doc</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">();</span>
            
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentFont</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">tagStyle</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">tagStyle</span> <span class="o">=</span> <span class="o">{};</span>
                <span class="o">}</span>
                <span class="nx">tagStyle</span><span class="o">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentFont</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentFont</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="o">[];</span>

            <span class="k">var</span> <span class="nx">_elCreate</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="nx">switch</span> <span class="o">(</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">case</span> <span class="s1">&#39;h1&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;h2&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;h3&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;h4&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;h5&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;h6&#39;</span><span class="o">:</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="nx">_doc</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="nx">tagName</span><span class="o">);</span>
                        <span class="k">break</span><span class="o">;</span>
                    <span class="nx">default</span><span class="o">:</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="nx">_doc</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;yui-tag-&#39;</span> <span class="o">+</span> <span class="nx">tagName</span><span class="o">);</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;yui-tag&#39;</span><span class="o">);</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;tag&#39;</span><span class="o">,</span> <span class="nx">tagName</span><span class="o">);</span>

                        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">k</span> <span class="k">in</span> <span class="nx">tagStyle</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">tagStyle</span><span class="o">,</span> <span class="nx">k</span><span class="o">))</span> <span class="o">{</span>
                                <span class="nx">el</span><span class="o">.</span><span class="nx">style</span><span class="o">[</span><span class="nx">k</span><span class="o">]</span> <span class="o">=</span> <span class="nx">tagStyle</span><span class="o">[</span><span class="nx">k</span><span class="o">];</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">return</span> <span class="nx">el</span><span class="o">;</span>
            <span class="o">};</span>

            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasSelection</span><span class="o">())</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">queryCommandEnabled</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;insertimage&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="s1">&#39;yui-tmp-img&#39;</span><span class="o">);</span>
                    <span class="k">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;img&#39;</span><span class="o">);</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">imgs</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">imgs</span><span class="o">[</span><span class="nx">j</span><span class="o">].</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp-img&#39;</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="o">();</span>
                            <span class="nx">imgs</span><span class="o">[</span><span class="nx">j</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">imgs</span><span class="o">[</span><span class="nx">j</span><span class="o">]);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">tar</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="c">//For Safari..</span>
<span class="c"></span>                        <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">;</span>                        
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">tar</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">/**</span>
<span class="c">                    * @knownissue</span>
<span class="c">                    * @browser Safari 2.x</span>
<span class="c">                    * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="c">                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="c">                    */</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">tar</span><span class="o">,</span> <span class="s1">&#39;body&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">tar</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">tar</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">tar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">tar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="c">//this.currentElement = el;</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//Force Safari to focus the new element</span>
<span class="c"></span>                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="nx">el</span><span class="o">,</span> <span class="m">0</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapseToStart</span><span class="o">();</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="c">//Force CSS Styling for this action...</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">_setEditorStyle</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">execCommand</span><span class="o">(</span><span class="s1">&#39;fontname&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp</span> <span class="o">=</span> <span class="o">[];</span>
                <span class="c">/* TODO: This needs to be cleaned up.. */</span>
                <span class="k">var</span> <span class="nx">_tmp1</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;font&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp2</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">().</span><span class="nx">tagName</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp3</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp4</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;i&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp5</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;b&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">_tmp6</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getSelectedElement</span><span class="o">().</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">);</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e1</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e1</span> <span class="o">&lt;</span> <span class="nx">_tmp1</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e1</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp1</span><span class="o">[</span><span class="nx">e1</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e6</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e6</span> <span class="o">&lt;</span> <span class="nx">_tmp6</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e6</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp6</span><span class="o">[</span><span class="nx">e6</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e2</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e2</span> <span class="o">&lt;</span> <span class="nx">_tmp2</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e2</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp2</span><span class="o">[</span><span class="nx">e2</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e3</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e3</span> <span class="o">&lt;</span> <span class="nx">_tmp3</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e3</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp3</span><span class="o">[</span><span class="nx">e3</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e4</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e4</span> <span class="o">&lt;</span> <span class="nx">_tmp4</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e4</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp4</span><span class="o">[</span><span class="nx">e4</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e5</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e5</span> <span class="o">&lt;</span> <span class="nx">_tmp5</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">e5</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">_tmp</span><span class="o">[</span><span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">_tmp5</span><span class="o">[</span><span class="nx">e5</span><span class="o">];</span>
                <span class="o">}</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">_tmp</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;font-family&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">face</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">face</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="o">)))</span> <span class="o">{</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="o">();</span>
                        <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">innerHTML</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;ol&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;ul&#39;</span><span class="o">)))</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">fc</span> <span class="o">=</span> <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
                            <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="o">;</span>
                            <span class="nx">fc</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="o">;</span>
                            <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">fc</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                            <span class="nx">fc</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="nx">fc</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="s1">&#39;li&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                            <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
                            <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">style</span><span class="o">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">_tmp</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="c">//Force Safari to focus the new element</span>
<span class="c"></span>                                    <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">setBaseAndExtent</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="nx">el</span><span class="o">,</span> <span class="m">0</span><span class="o">);</span>
                                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit3</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapseToStart</span><span class="o">();</span>
                                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                        <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                                    <span class="o">}</span>
                                <span class="o">}</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="nx">tagStyle</span> <span class="o">&amp;&amp;</span> <span class="nx">tagStyle</span><span class="o">.</span><span class="nx">fontSize</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">empty</span><span class="o">();</span>
                                <span class="o">}</span>
                                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">gecko</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">this</span><span class="o">.</span><span class="nx">_getSelection</span><span class="o">().</span><span class="nx">collapseToStart</span><span class="o">();</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">e</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">e</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">e</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">e</span> <span class="o">+</span> <span class="m">1</span><span class="o">)</span> <span class="o">!=</span> <span class="nx">len</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Skip the last one in the list</span>
<span class="c"></span>                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">e</span><span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">e</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">e</span><span class="o">],</span> <span class="s1">&#39;br&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="nx">e</span><span class="o">].</span><span class="nx">nextSibling</span><span class="o">;</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method saveHTML</span>
<span class="c">        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.</span>
<span class="c">        */</span>
        <span class="nx">saveHTML</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cleanHTML</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">html</span><span class="o">;</span>
            <span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method setEditorHTML</span>
<span class="c">        * @param {String} html The html content to load into the editor</span>
<span class="c">        * @description Loads HTML into the editors body</span>
<span class="c">        */</span>
        <span class="nx">setEditorHTML</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nodeChange</span><span class="o">();</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getEditorHTML</span>
<span class="c">        * @description Gets the unprocessed/unfiltered HTML from the editor</span>
<span class="c">        */</span>
        <span class="nx">getEditorHTML</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method show</span>
<span class="c">        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.</span>
<span class="c">        */</span>
        <span class="nx">show</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">gecko</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_setDesignMode</span><span class="o">(</span><span class="s1">&#39;on&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_focusWindow</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">_setInitialContent</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">);</span>
                <span class="o">},</span> <span class="m">10</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="c">//Adding this will close all other Editor window&#39;s when showing this one.</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="c">//Put the iframe back in place</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;position&#39;</span><span class="o">,</span> <span class="s1">&#39;static&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method hide</span>
<span class="c">        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.</span>
<span class="c">        */</span>
        <span class="nx">hide</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="c">//Adding this will close all other Editor window&#39;s.</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_fixNodesTimer</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_fixNodesTimer</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="c">//Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;position&#39;</span><span class="o">,</span> <span class="s1">&#39;absolute&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method cleanHTML</span>
<span class="c">        * @param {String} html The unfiltered HTML</span>
<span class="c">        * @description Process the HTML with a few regexes to clean it up and stabilize the output</span>
<span class="c">        * @returns {String} The filtered HTML</span>
<span class="c">        */</span>
        <span class="nx">cleanHTML</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">//Start Filtering Output</span>
<span class="c"></span>            <span class="c">//Begin RegExs..</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(!</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span> 
                <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEditorHTML</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">markup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;markup&#39;</span><span class="o">);</span>
            <span class="c">//Make some backups...</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;br class=&quot;khtml-block-placeholder&quot;&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;br class=&quot;webkit-block-placeholder&quot;&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
            <span class="o">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;br&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;br\/&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;br \/&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;div&gt;&lt;YUI_BR&gt;&lt;\/div&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;p&gt;(&amp;nbsp;|&amp;#160;)&lt;\/p&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>            
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;p&gt;&lt;br&gt;&amp;nbsp;&lt;\/p&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;p&gt;&amp;nbsp;&lt;\/p&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;img([^&gt;]*)\/&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_IMG$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;img([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_IMG$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;ul([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_UL$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/ul&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;\/YUI_UL&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;blockquote([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;YUI_BQ$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/blockquote&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;\/YUI_BQ&gt;&#39;</span><span class="o">);</span>

            <span class="c">//Convert b and i tags to strong and em tags</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">((</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;i([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;em$1&gt;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/i&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/em&gt;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;b([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;strong$1&gt;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/b&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/strong&gt;&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            
            <span class="c">//Case Changing</span>
<span class="c"></span>		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;font/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;font&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/font&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/font&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;span/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;span&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/span&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="o">(</span><span class="s1">&#39;&lt;font([^&gt;]*)face=&quot;([^&gt;]*)&quot;&gt;(.*?)&lt;\/font&gt;&#39;</span><span class="o">,</span> <span class="s1">&#39;gi&#39;</span><span class="o">),</span> <span class="s1">&#39;&lt;span $1 style=&quot;font-family: $2;&quot;&gt;$3&lt;/span&gt;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;u/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;span style=&quot;text-decoration: underline;&quot;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/u&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;em([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;i$1&gt;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/em&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/i&gt;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;strong([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;b$1&gt;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/strong&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/b&gt;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;b/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;span style=&quot;font-weight: bold;&quot;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/b&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;i/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;span style=&quot;font-style: italic;&quot;&#39;</span><span class="o">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/i&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/  /gi</span><span class="o">,</span> <span class="s1">&#39; &#39;</span><span class="o">);</span> <span class="c">//Replace all double spaces and replace with a single</span>
<span class="c"></span>            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;u/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;u&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/u&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/u&gt;&#39;</span><span class="o">);</span>
            <span class="o">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;ol([^&gt;]*)&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;ol$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/ol&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/ol&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;li/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;li&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\/li&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;/li&gt;&#39;</span><span class="o">);</span>

            <span class="c">//Fix stuff we don&#39;t want</span>
<span class="c"></span>	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/?(body|head|html)[^&gt;]*&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="c">//Fix last BR</span>
<span class="c"></span>	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BR&gt;$/</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="c">//Fix last BR in P</span>
<span class="c"></span>	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BR&gt;&lt;\/p&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="o">);</span>
            <span class="c">//Fix last BR in LI</span>
<span class="c"></span>		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BR&gt;&lt;\/li&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="o">);</span>

            <span class="c">//Safari only regexes</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">//&lt;DIV&gt;&lt;SPAN class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;Test THis&lt;/SPAN&gt;&lt;/DIV&gt;</span>
<span class="c"></span>                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/Apple-style-span/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/style=&quot;line-height: normal;&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="c">//Remove bogus LI&#39;s</span>
<span class="c"></span>                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;li&gt;&lt;\/li&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;li&gt; &lt;\/li&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="c">//Remove bogus DIV&#39;s</span>
<span class="c"></span>                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;div&gt;&lt;\/div&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;div&gt; &lt;\/div&gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="o">}</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/yui-tag-span/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/yui-tag/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/yui-non/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/yui-img/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ tag=&quot;span&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ class=&quot;&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ style=&quot;&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ class=&quot; &quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ class=&quot;  &quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ target=&quot;&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ title=&quot;&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="m">5</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="o">(</span><span class="s1">&#39;&lt;span&gt;(.*?)&lt;\/span&gt;&#39;</span><span class="o">,</span> <span class="s1">&#39;gi&#39;</span><span class="o">),</span> <span class="s1">&#39;$1&#39;</span><span class="o">);</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ class= /gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ class= &gt;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/_height=&quot;([^&gt;])&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/_width=&quot;([^&gt;])&quot;/gi</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            
            <span class="c">//Replace our backups with the real thing</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">)</span> <span class="o">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BR&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;br/&gt;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_IMG([^&gt;]*)&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;img $1/&gt;&#39;</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BR&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="o">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_IMG([^&gt;]*)&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;img $1&gt;&#39;</span><span class="o">);</span>
            <span class="o">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_UL([^&gt;]*)&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;ul$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/YUI_UL&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;\/ul&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;YUI_BQ([^&gt;]*)&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;blockquote$1&gt;&#39;</span><span class="o">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/&lt;\/YUI_BQ&gt;/g</span><span class="o">,</span> <span class="s1">&#39;&lt;\/blockquote&gt;&#39;</span><span class="o">);</span>

            <span class="c">//Trim the output, removing whitespace from the beginning and end</span>
<span class="c"></span>            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/^\s+/g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\s+$/g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;removeLineBreaks&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\n/g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\r/g</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/  /gi</span><span class="o">,</span> <span class="s1">&#39; &#39;</span><span class="o">);</span> <span class="c">//Replace all double spaces and replace with a single</span>
<span class="c"></span>            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method clearEditorDoc</span>
<span class="c">        * @description Clear the doc of the Editor</span>
<span class="c">        */</span>
        <span class="nx">clearEditorDoc</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">().</span><span class="nx">body</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _renderPanel</span>
<span class="c">        * @description Renders the panel used for Editor Windows to the document so we can start using it..</span>
<span class="c">        * @returns {&lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;}</span>
<span class="c">        */</span>
        <span class="nx">_renderPanel</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">panel</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nx">panel</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">panel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">EDITOR_PANEL_ID</span><span class="o">,</span> <span class="o">{</span>
                    <span class="nx">width</span><span class="o">:</span> <span class="s1">&#39;300px&#39;</span><span class="o">,</span>
                    <span class="nx">iframe</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                    <span class="nx">visible</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                    <span class="nx">underlay</span><span class="o">:</span> <span class="s1">&#39;none&#39;</span><span class="o">,</span>
                    <span class="nx">draggable</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                    <span class="nx">close</span><span class="o">:</span> <span class="kc">false</span>
                <span class="o">});</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nx">panel</span> <span class="o">=</span> <span class="nx">panel</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">panel</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nx">panel</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">,</span> <span class="nx">panel</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setBody</span><span class="o">(</span><span class="s1">&#39;---&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setHeader</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">DOMReady</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">render</span><span class="o">(</span><span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">);</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-editor-panel&#39;</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">onDOMReady</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">render</span><span class="o">(</span><span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">);</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-editor-panel&#39;</span><span class="o">);</span>
                <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;display&#39;</span><span class="o">,</span> <span class="s1">&#39;block&#39;</span><span class="o">);</span>
            <span class="o">});</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method openWindow</span>
<span class="c">        * @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;YAHOO.widget.EditorWindow&lt;/a&gt;} win A &lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;YAHOO.widget.EditorWindow&lt;/a&gt; instance</span>
<span class="c">        * @description Opens a new &quot;window/panel&quot;</span>
<span class="c">        */</span>
        <span class="nx">openWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">win</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;openWindow: &#39;</span> <span class="o">+</span> <span class="nx">win</span><span class="o">.</span><span class="nx">name</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span> <span class="c">//Disable the toolbar when an editor window is open..</span>
<span class="c"></span>            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="s1">&#39;keypress&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_closeWindow</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">win</span><span class="o">;</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span><span class="o">.</span><span class="nx">scope</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
                <span class="nx">xy</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span>
                <span class="nx">elXY</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">)),</span>
                <span class="nx">panel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">),</span>
                <span class="nx">newXY</span> <span class="o">=</span> <span class="o">[(</span><span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="m">20</span><span class="o">),</span> <span class="o">(</span><span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="m">10</span><span class="o">)],</span>
                <span class="nx">wWidth</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">attrs</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">/</span> <span class="m">2</span><span class="o">),</span>
                <span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;center&#39;</span><span class="o">,</span>
                <span class="nx">body</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;beforeOpenWindow&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeOpenWindow&#39;</span><span class="o">,</span> <span class="nx">win</span><span class="o">:</span> <span class="nx">win</span><span class="o">,</span> <span class="nx">panel</span><span class="o">:</span> <span class="nx">panel</span> <span class="o">});</span>

            <span class="nx">body</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
            <span class="nx">body</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-body-cont&#39;</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">b</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">[</span><span class="nx">b</span><span class="o">])</span> <span class="o">{</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">body</span><span class="o">,</span> <span class="nx">b</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">var</span> <span class="nx">_note</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h3&#39;</span><span class="o">);</span>
            <span class="nx">_note</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-editor-skipheader&#39;</span><span class="o">;</span>
            <span class="nx">_note</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_CLOSE_WINDOW_NOTE</span><span class="o">;</span>
            <span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_note</span><span class="o">);</span>
            <span class="nx">form</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;form&#39;</span><span class="o">);</span>
            <span class="nx">form</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;method&#39;</span><span class="o">,</span> <span class="s1">&#39;GET&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">windowName</span> <span class="o">=</span> <span class="nx">win</span><span class="o">.</span><span class="nx">name</span><span class="o">;</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">form</span><span class="o">,</span> <span class="s1">&#39;submit&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">evName</span> <span class="o">=</span> <span class="s1">&#39;window&#39;</span> <span class="o">+</span> <span class="nx">windowName</span> <span class="o">+</span> <span class="s1">&#39;Submit&#39;</span><span class="o">;</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="nx">evName</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">evName</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">form</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">body</span><span class="o">))</span> <span class="o">{</span> <span class="c">//Assume it&#39;s a reference</span>
<span class="c"></span>                <span class="nx">form</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">body</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span> <span class="c">//Assume it&#39;s a string</span>
<span class="c"></span>                <span class="k">var</span> <span class="nx">_tmp</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                <span class="nx">_tmp</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">win</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
                <span class="nx">form</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_tmp</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">_close</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
            <span class="nx">_close</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;X&#39;</span><span class="o">;</span>
            <span class="nx">_close</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_CLOSE_WINDOW</span><span class="o">;</span>
            <span class="nx">_close</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;close&#39;</span><span class="o">;</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">_close</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">_knob</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
            <span class="nx">_knob</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;^&#39;</span><span class="o">;</span>
            <span class="nx">_knob</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;knob&#39;</span><span class="o">;</span>
            <span class="nx">win</span><span class="o">.</span><span class="nx">_knob</span> <span class="o">=</span> <span class="nx">_knob</span><span class="o">;</span>

            <span class="k">var</span> <span class="nx">_header</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h3&#39;</span><span class="o">);</span>
            <span class="nx">_header</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">win</span><span class="o">.</span><span class="nx">header</span><span class="o">;</span>

            <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="nx">win</span><span class="o">.</span><span class="nx">attrs</span><span class="o">.</span><span class="nx">width</span><span class="o">);</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">setHeader</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span> <span class="c">//Clear the current header</span>
<span class="c"></span>            <span class="nx">panel</span><span class="o">.</span><span class="nx">appendToHeader</span><span class="o">(</span><span class="nx">_header</span><span class="o">);</span>
            <span class="nx">_header</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_close</span><span class="o">);</span>
            <span class="nx">_header</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_knob</span><span class="o">);</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">setBody</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span> <span class="c">//Clear the current body</span>
<span class="c"></span>            <span class="nx">panel</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">);</span> <span class="c">//Clear the current footer</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">footer</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">panel</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">footer</span><span class="o">);</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">footer</span><span class="o">,</span> <span class="s1">&#39;open&#39;</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">footer</span><span class="o">,</span> <span class="s1">&#39;open&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">appendToBody</span><span class="o">(</span><span class="nx">body</span><span class="o">);</span> <span class="c">//Append the new DOM node to it</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">fireShowEvent</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nx">panel</span><span class="o">.</span><span class="nx">bringToTop</span><span class="o">();</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">stopPropagation</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">});</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_setBusy</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
                <span class="nx">panel</span><span class="o">.</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">fireShowEvent</span><span class="o">);</span>
            <span class="o">};</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">fireShowEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">fireCloseEvent</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">evName</span> <span class="o">=</span> <span class="s1">&#39;window&#39;</span> <span class="o">+</span> <span class="nx">windowName</span> <span class="o">+</span> <span class="s1">&#39;Close&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="nx">evName</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">evName</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
                <span class="nx">panel</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">fireCloseEvent</span><span class="o">);</span>
            <span class="o">};</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">fireCloseEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">=</span> <span class="nx">win</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">moveWindow</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
            <span class="nx">panel</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;afterOpenWindow&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterOpenWindow&#39;</span><span class="o">,</span> <span class="nx">win</span><span class="o">:</span> <span class="nx">win</span><span class="o">,</span> <span class="nx">panel</span><span class="o">:</span> <span class="nx">panel</span> <span class="o">});</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method moveWindow</span>
<span class="c">        * @param {Boolean} force Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.)</span>
<span class="c">        * @description Realign the window with the currentElement and reposition the knob above the panel.</span>
<span class="c">        */</span>
        <span class="nx">moveWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">force</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">win</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">,</span>
                <span class="nx">xy</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span>
                <span class="nx">elXY</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">)),</span>
                <span class="nx">panel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">),</span>
                <span class="c">//newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],</span>
<span class="c"></span>                <span class="nx">newXY</span> <span class="o">=</span> <span class="o">[(</span><span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span> <span class="o">(</span><span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">1</span><span class="o">])],</span>
                <span class="nx">wWidth</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">attrs</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">/</span> <span class="m">2</span><span class="o">),</span>
                <span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;center&#39;</span><span class="o">,</span>
                <span class="nx">orgXY</span> <span class="o">=</span> <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">),</span>
                <span class="nx">_knob</span> <span class="o">=</span> <span class="nx">win</span><span class="o">.</span><span class="nx">_knob</span><span class="o">,</span>
                <span class="nx">xDiff</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                <span class="nx">yDiff</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                <span class="nx">anim</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

            <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="o">((</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">wWidth</span><span class="o">)</span> <span class="o">+</span> <span class="m">20</span><span class="o">);</span>
            <span class="c">//Account for the Scroll bars in a scrolled editor window.</span>
<span class="c"></span>            <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getDocumentScrollLeft</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">());</span>
            <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getDocumentScrollTop</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_getDoc</span><span class="o">());</span>
            


            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_isElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">src</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;blankimage&#39;</span><span class="o">))</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="o">(</span><span class="m">75</span> <span class="sr">/ 2)); /</span><span class="o">/</span><span class="nx">Placeholder</span> <span class="nx">size</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="m">75</span><span class="o">);</span> <span class="c">//Placeholder sizea</span>
<span class="c"></span>                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">w</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">height</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="o">(</span><span class="nx">w</span> <span class="o">/</span> <span class="m">2</span><span class="o">));</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nx">h</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="m">15</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;fontSize&#39;</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">fs</span> <span class="o">&amp;&amp;</span> <span class="nx">fs</span><span class="o">.</span><span class="nx">indexOf</span> <span class="o">&amp;&amp;</span> <span class="nx">fs</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;px&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;fontSize&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">)</span> <span class="o">+</span> <span class="m">5</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="m">20</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">&lt;</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="m">5</span><span class="o">;</span>
                <span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;left&#39;</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">((</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="o">(</span><span class="nx">wWidth</span> <span class="o">*</span> <span class="m">2</span><span class="o">))</span> <span class="o">&gt;</span> <span class="o">(</span><span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">clientWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">)))</span> <span class="o">{</span>
                <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">=</span> <span class="o">((</span><span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;iframe&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">clientWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">))</span> <span class="o">-</span> <span class="o">(</span><span class="nx">wWidth</span> <span class="o">*</span> <span class="m">2</span><span class="o">)</span> <span class="o">-</span> <span class="m">5</span><span class="o">);</span>
                <span class="nx">align</span> <span class="o">=</span> <span class="s1">&#39;right&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            
            <span class="k">try</span> <span class="o">{</span>
                <span class="nx">xDiff</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">orgXY</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                <span class="nx">yDiff</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="nx">orgXY</span><span class="o">[</span><span class="m">1</span><span class="o">]);</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{}</span>
            
            <span class="c">//Convert negative numbers to positive so we can get the difference in distance</span>
<span class="c"></span>            <span class="nx">xDiff</span> <span class="o">=</span> <span class="o">((</span><span class="nx">xDiff</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">?</span> <span class="o">(</span><span class="nx">xDiff</span> <span class="o">*</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">:</span> <span class="nx">xDiff</span><span class="o">);</span>
            <span class="nx">yDiff</span> <span class="o">=</span> <span class="o">((</span><span class="nx">yDiff</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">?</span> <span class="o">(</span><span class="nx">yDiff</span> <span class="o">*</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">:</span> <span class="nx">yDiff</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(((</span><span class="nx">xDiff</span> <span class="o">&gt;</span> <span class="m">10</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">yDiff</span> <span class="o">&gt;</span> <span class="m">10</span><span class="o">))</span> <span class="o">||</span> <span class="nx">force</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Only move the window if it&#39;s supposed to move more than 10px or force was passed (new window)</span>
<span class="c"></span>                <span class="k">var</span> <span class="nx">_knobLeft</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                    <span class="nx">elW</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">width</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">elW</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentElement</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">/</span> <span class="m">2</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="k">var</span> <span class="nx">leftOffset</span> <span class="o">=</span> <span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nx">elW</span><span class="o">;</span>
                <span class="nx">_knobLeft</span> <span class="o">=</span> <span class="nx">leftOffset</span> <span class="o">-</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
                <span class="c">//Check to see if the knob will go off either side &amp; reposition it</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">_knobLeft</span> <span class="o">&gt;</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">attrs</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">-</span> <span class="m">40</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">_knobLeft</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">win</span><span class="o">.</span><span class="nx">attrs</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">-</span> <span class="m">40</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">_knobLeft</span> <span class="o">&lt;</span> <span class="m">40</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_knobLeft</span> <span class="o">=</span> <span class="m">40</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nb">isNaN</span><span class="o">(</span><span class="nx">_knobLeft</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">_knobLeft</span> <span class="o">=</span> <span class="m">40</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">force</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">_knob</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">_knob</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">_knobLeft</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;animate&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;opacity&#39;</span><span class="o">,</span> <span class="s1">&#39;0&#39;</span><span class="o">);</span>
                        <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="o">{</span>
                            <span class="nx">opacity</span><span class="o">:</span> <span class="o">{</span>
                                <span class="nx">from</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>
                                <span class="nx">to</span><span class="o">:</span> <span class="m">1</span>
                            <span class="o">}</span>
                        <span class="o">},</span> <span class="m">0</span><span class="o">.</span><span class="m">1</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Easing</span><span class="o">.</span><span class="nx">easeOut</span><span class="o">);</span>
                        <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">,</span> <span class="nx">newXY</span><span class="o">);</span>
                        <span class="nx">anim</span><span class="o">.</span><span class="nx">onComplete</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">panel</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">filter</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="o">;</span>
                            <span class="o">}</span>
                        <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="nx">anim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">,</span> <span class="nx">newXY</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;animate&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="o">{},</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Easing</span><span class="o">.</span><span class="nx">easeOut</span><span class="o">);</span>
                        <span class="nx">anim</span><span class="o">.</span><span class="nx">attributes</span> <span class="o">=</span> <span class="o">{</span>
                            <span class="nx">top</span><span class="o">:</span> <span class="o">{</span>
                                <span class="nx">to</span><span class="o">:</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">1</span><span class="o">]</span>
                            <span class="o">},</span>
                            <span class="nx">left</span><span class="o">:</span> <span class="o">{</span>
                                <span class="nx">to</span><span class="o">:</span> <span class="nx">newXY</span><span class="o">[</span><span class="m">0</span><span class="o">]</span>
                            <span class="o">}</span>
                        <span class="o">};</span>
                        <span class="nx">anim</span><span class="o">.</span><span class="nx">onComplete</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">,</span> <span class="nx">newXY</span><span class="o">);</span>
                        <span class="o">});</span>
                        <span class="c">//We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed ..</span>
<span class="c"></span>                        <span class="k">var</span> <span class="nx">iframeAnim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="nx">panel</span><span class="o">.</span><span class="nx">iframe</span><span class="o">,</span> <span class="nx">anim</span><span class="o">.</span><span class="nx">attributes</span><span class="o">,</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Easing</span><span class="o">.</span><span class="nx">easeOut</span><span class="o">);</span>

                        <span class="k">var</span> <span class="nx">_knobAnim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">(</span><span class="nx">_knob</span><span class="o">,</span> <span class="o">{</span>
                            <span class="nx">left</span><span class="o">:</span> <span class="o">{</span>
                                <span class="nx">to</span><span class="o">:</span> <span class="nx">_knobLeft</span>
                            <span class="o">}</span>
                        <span class="o">},</span> <span class="m">0</span><span class="o">.</span><span class="m">6</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Easing</span><span class="o">.</span><span class="nx">easeOut</span><span class="o">);</span>
                        <span class="nx">anim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                        <span class="nx">iframeAnim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                        <span class="nx">_knobAnim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">_knob</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">_knobLeft</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                        <span class="nx">panel</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">,</span> <span class="nx">newXY</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _closeWindow</span>
<span class="c">        * @description Close the currently open EditorWindow with the Escape key.</span>
<span class="c">        * @param {Event} ev The keypress Event that we are trapping</span>
<span class="c">        */</span>
        <span class="nx">_closeWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">ev</span><span class="o">.</span><span class="nx">charCode</span> <span class="o">==</span> <span class="m">87</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">ctrlKey</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">closeWindow</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method closeWindow</span>
<span class="c">        * @description Close the currently open EditorWindow.</span>
<span class="c">        */</span>
        <span class="nx">closeWindow</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;closeWindow: &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span><span class="o">.</span><span class="nx">name</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Editor&#39;</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span><span class="o">.</span><span class="nb">window</span> <span class="o">=</span> <span class="o">{};</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;closeWindow&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;closeWindow&#39;</span><span class="o">,</span> <span class="nx">win</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">});</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">currentWindow</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">hide</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;xy&#39;</span><span class="o">,</span> <span class="o">[-</span><span class="m">900</span><span class="o">,-</span><span class="m">900</span><span class="o">]);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;panel&#39;</span><span class="o">).</span><span class="nx">syncIframe</span><span class="o">();</span> <span class="c">//Needed to move the iframe with the hidden panel</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span> <span class="c">//enable the toolbar now that the window is closed</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">resetAllButtons</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_focusWindow</span><span class="o">();</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="s1">&#39;keypress&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_closeWindow</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method destroy</span>
<span class="c">        * @description Destroys the editor, all of it&#39;s elements and objects.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">destroy</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">saveHTML</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">toolbar</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;visibility&#39;</span><span class="o">,</span> <span class="s1">&#39;hidden&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;position&#39;</span><span class="o">,</span> <span class="s1">&#39;absolute&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;top&#39;</span><span class="o">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">textArea</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;parentNode&#39;</span><span class="o">).</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">textArea</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="c">//Brutal Object Destroy</span>
<span class="c"></span>            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">},</span>        
        <span class="c">/**</span>
<span class="c">        * @method toString</span>
<span class="c">        * @description Returns a string representing the editor.</span>
<span class="c">        * @return {String}</span>
<span class="c">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;Editor&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;Editor (#&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element_cont&#39;</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39; Disabled&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">));</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">str</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">});</span>

<span class="c">/**</span>
<span class="c">* @event toolbarLoaded</span>
<span class="c">* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event afterRender</span>
<span class="c">* @description Event is fired after the render process finishes. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorContentLoaded</span>
<span class="c">* @description Event is fired after the editor iframe&#39;s document fully loads and fires it&#39;s onload event. From here you can start injecting your own things into the document. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorMouseUp</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorMouseDown</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorDoubleClick</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorKeyUp</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorKeyPress</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event editorKeyDown</span>
<span class="c">* @param {Event} ev The DOM Event that occured</span>
<span class="c">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event beforeNodeChange</span>
<span class="c">* @description Event fires at the beginning of the nodeChange process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event afterNodeChange</span>
<span class="c">* @description Event fires at the end of the nodeChange process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event beforeExecCommand</span>
<span class="c">* @description Event fires at the beginning of the execCommand process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event afterExecCommand</span>
<span class="c">* @description Event fires at the end of the execCommand process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event beforeOpenWindow</span>
<span class="c">* @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt;} win The EditorWindow object</span>
<span class="c">* @param {Overlay} panel The Overlay object that is used to create the window.</span>
<span class="c">* @description Event fires before an Editor Window is opened. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event afterOpenWindow</span>
<span class="c">* @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt;} win The EditorWindow object</span>
<span class="c">* @param {Overlay} panel The Overlay object that is used to create the window.</span>
<span class="c">* @description Event fires after an Editor Window is opened. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event closeWindow</span>
<span class="c">* @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt;} win The EditorWindow object</span>
<span class="c">* @description Event fires after an Editor Window is closed. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event windowCMDOpen</span>
<span class="c">* @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt;} win The EditorWindow object</span>
<span class="c">* @param {Overlay} panel The Overlay object that is used to create the window.</span>
<span class="c">* @description Dynamic event fired when an &lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt; is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event windowCMDClose</span>
<span class="c">* @param {&lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt;} win The EditorWindow object</span>
<span class="c">* @param {Overlay} panel The Overlay object that is used to create the window.</span>
<span class="c">* @description Dynamic event fired when an &lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;EditorWindow&lt;/a&gt; is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>

<span class="c">/**</span>
<span class="c">     * @description Singleton object used to track the open window objects and panels across the various open editors</span>
<span class="c">     * @class EditorInfo</span>
<span class="c">     * @static</span>
<span class="c">    */</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorInfo</span> <span class="o">=</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _instances</span>
<span class="c">        * @description A reference to all editors on the page.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_instances</span><span class="o">:</span> <span class="o">{},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property window</span>
<span class="c">        * @description A reference to the currently open window object in any editor on the page.</span>
<span class="c">        * @type Object &lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;YAHOO.widget.EditorWindow&lt;/a&gt;</span>
<span class="c">        */</span>
        <span class="nb">window</span><span class="o">:</span> <span class="o">{},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property panel</span>
<span class="c">        * @description A reference to the currently open panel in any editor on the page.</span>
<span class="c">        * @type Object &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;</span>
<span class="c">        */</span>
        <span class="nx">panel</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @method getEditorById</span>
<span class="c">        * @description Returns a reference to the Editor object associated with the given textarea</span>
<span class="c">        * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of</span>
<span class="c">        * @returns Object &lt;a href=&quot;YAHOO.widget.Editor.html&quot;&gt;YAHOO.widget.Editor&lt;/a&gt;</span>
<span class="c">        */</span>
        <span class="nx">getEditorById</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="c">//Not a string, assume a node Reference</span>
<span class="c"></span>                <span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">])</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">];</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method toString</span>
<span class="c">        * @description Returns a string representing the EditorInfo.</span>
<span class="c">        * @return {String}</span>
<span class="c">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">_instances</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">len</span><span class="o">++;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="s1">&#39;Editor Info (&#39;</span> <span class="o">+</span> <span class="nx">len</span> <span class="o">+</span> <span class="s1">&#39; registered intance&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">len</span> <span class="o">&gt;</span> <span class="m">1</span><span class="o">)</span> <span class="o">?</span> <span class="s1">&#39;s&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">};</span>

    <span class="c">/**</span>
<span class="c">     * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown.</span>
<span class="c">     * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor.</span>
<span class="c">     * @class EditorWindow</span>
<span class="c">     * @param {String} name The name of the window.</span>
<span class="c">     * @param {Object} attrs Attributes for the window. Current attributes used are : height and width</span>
<span class="c">    */</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorWindow</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">name</span><span class="o">,</span> <span class="nx">attrs</span><span class="o">)</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property name</span>
<span class="c">        * @description A unique name for the window</span>
<span class="c">        */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">name</span> <span class="o">=</span> <span class="nx">name</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39; &#39;</span><span class="o">,</span> <span class="s1">&#39;_&#39;</span><span class="o">);</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property attrs</span>
<span class="c">        * @description The window attributes</span>
<span class="c">        */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">attrs</span> <span class="o">=</span> <span class="nx">attrs</span><span class="o">;</span>
    <span class="o">};</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">EditorWindow</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _cache</span>
<span class="c">        * @description Holds a cache of the DOM for the window so we only have to build it once..</span>
<span class="c">        */</span>
        <span class="nx">_cache</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property header</span>
<span class="c">        * @description Holder for the header of the window, used in Editor.openWindow</span>
<span class="c">        */</span>
        <span class="nx">header</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property body</span>
<span class="c">        * @description Holder for the body of the window, used in Editor.openWindow</span>
<span class="c">        */</span>
        <span class="nx">body</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property footer</span>
<span class="c">        * @description Holder for the footer of the window, used in Editor.openWindow</span>
<span class="c">        */</span>
        <span class="nx">footer</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @method setHeader</span>
<span class="c">        * @description Sets the header for the window.</span>
<span class="c">        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows header.</span>
<span class="c">        */</span>
        <span class="nx">setHeader</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">str</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">header</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method setBody</span>
<span class="c">        * @description Sets the body for the window.</span>
<span class="c">        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows body.</span>
<span class="c">        */</span>
        <span class="nx">setBody</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">str</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">body</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method setFooter</span>
<span class="c">        * @description Sets the footer for the window.</span>
<span class="c">        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows footer.</span>
<span class="c">        */</span>
        <span class="nx">setFooter</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">str</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">footer</span> <span class="o">=</span> <span class="nx">str</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method toString</span>
<span class="c">        * @description Returns a string representing the EditorWindow.</span>
<span class="c">        * @return {String}</span>
<span class="c">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="s1">&#39;Editor Window (&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">name</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">};</span>


    
<span class="o">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class=""><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class=""><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_colorpicker.html">colorpicker</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class=""><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class="selected"><a href="module_editor.html">editor</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_imageloader.html">imageloader</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class=""><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>

                                <li class=""><a href="module_yuiloader.html">yuiloader</a></li>

                                <li class=""><a href="module_yuitest.html">yuitest</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a></li>
                                <li class=""><a href="YAHOO.widget.EditorInfo.html">YAHOO.widget.EditorInfo</a></li>
                                <li class=""><a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a></li>
                                <li class=""><a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="editor.js.html">editor.js</a></li>
                                <li class=""><a href="toolbar.js.html">toolbar.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
